This commit is contained in:
randomuser 2022-07-19 04:03:49 +00:00
parent 726ed6c6bc
commit 7f8405d177
1 changed files with 6 additions and 5 deletions

11
main.py
View File

@ -28,7 +28,7 @@ from ircrobots import Server as BaseServer
from ircrobots import ConnectionParams from ircrobots import ConnectionParams
SERVERS = [ SERVERS = [
("beep", "beepboop.systems") ("localhost", "localhost")
] ]
EVENTS = [ EVENTS = [
"cmd", "cmd",
@ -45,10 +45,11 @@ PREFIX = '*'
class Admin: class Admin:
def __init__(self, nick): def __init__(self, nick):
self.nicks = [] self.nicks = nick
self.nicks.append(nick)
def __eq__(self, val): def __eq__(self, val):
return val in self.nicks return val in self.nicks
def __contains__(self, val):
return val in self.nicks
def append(self, nick): def append(self, nick):
self.nicks.append(nick) self.nicks.append(nick)
def remove(self, nick): def remove(self, nick):
@ -56,12 +57,12 @@ class Admin:
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] admins = Admin(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()}")
if line.command == "001": if line.command == "001":
await self.send(build("JOIN", ["#testchannel"])) await self.send(build("JOIN", ["#chaos"]))
self.load_mod("default") self.load_mod("default")
self.event_handle(line) self.event_handle(line)