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
SERVERS = [
("beep", "beepboop.systems")
("localhost", "localhost")
]
EVENTS = [
"cmd",
@ -45,10 +45,11 @@ PREFIX = '*'
class Admin:
def __init__(self, nick):
self.nicks = []
self.nicks.append(nick)
self.nicks = nick
def __eq__(self, val):
return val in self.nicks
def __contains__(self, val):
return val in self.nicks
def append(self, nick):
self.nicks.append(nick)
def remove(self, nick):
@ -56,12 +57,12 @@ class Admin:
class Server(BaseServer):
handlers = {i: [] for i in EVENTS}
admins = [Admin(i) for i in ADMINS]
admins = Admin(ADMINS)
states = {}
async def line_read(self, line: Line):
print(f"{self.name} < {line.format()}")
if line.command == "001":
await self.send(build("JOIN", ["#testchannel"]))
await self.send(build("JOIN", ["#chaos"]))
self.load_mod("default")
self.event_handle(line)