diff --git a/default.py b/default.py new file mode 100644 index 0000000..6d936b8 --- /dev/null +++ b/default.py @@ -0,0 +1,6 @@ +def cmd(line, srv): + splitted = line.params[1].split(' ') + command = splitted[0][1:] + if command == "load": + srv.load_mod(splitted[1]) + print("loaded") diff --git a/main.py b/main.py index 05e2443..bad181e 100644 --- a/main.py +++ b/main.py @@ -29,8 +29,7 @@ class Server(BaseServer): print(f"{self.name} < {line.format()}") if line.command == "001": await self.send(build("JOIN", ["#testchannel"])) - self.load_mod("test") - self.load_mod("test2") + self.load_mod("default") self.event_handle(line) def load_mod(self, name): @@ -55,7 +54,7 @@ class Server(BaseServer): if event == None: return False try: for i in self.handlers[event]: - i(line) + i(line, self) except IndexError: return False return True