add administration state handling

This commit is contained in:
randomuser 2021-08-11 20:52:56 -05:00
parent 472ba06b94
commit 1a0a8eae73
1 changed files with 13 additions and 0 deletions

13
main.py
View File

@ -40,10 +40,23 @@ EVENTS = [
"part", "part",
"invite", "invite",
] ]
ADMINS = ['rndusr']
PREFIX = '*' PREFIX = '*'
class Admin:
def __init__(self, nick):
self.nicks = []
self.nicks.append(nick)
def __eq__(self, val):
return val in self.nicks
def append(self, nick):
self.nicks.append(nick)
def remove(self, nick):
self.nicks.remove(nick)
class Server(BaseServer): class Server(BaseServer):
handlers = {i: [] for i in EVENTS} handlers = {i: [] for i in EVENTS}
admins = [Admin(i) for i in ADMINS]
states = {} states = {}
async def line_read(self, line: Line): async def line_read(self, line: Line):
print(f"{self.name} < {line.format()}") print(f"{self.name} < {line.format()}")