add default module
This commit is contained in:
parent
a96019ca07
commit
db61080a49
|
@ -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")
|
5
main.py
5
main.py
|
@ -29,8 +29,7 @@ class Server(BaseServer):
|
||||||
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", ["#testchannel"]))
|
||||||
self.load_mod("test")
|
self.load_mod("default")
|
||||||
self.load_mod("test2")
|
|
||||||
self.event_handle(line)
|
self.event_handle(line)
|
||||||
|
|
||||||
def load_mod(self, name):
|
def load_mod(self, name):
|
||||||
|
@ -55,7 +54,7 @@ class Server(BaseServer):
|
||||||
if event == None: return False
|
if event == None: return False
|
||||||
try:
|
try:
|
||||||
for i in self.handlers[event]:
|
for i in self.handlers[event]:
|
||||||
i(line)
|
i(line, self)
|
||||||
except IndexError: return False
|
except IndexError: return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue