Add commad via PM support

This commit is contained in:
hedy 2022-03-30 09:19:19 +08:00
parent 2107166407
commit cd71b3f443
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
1 changed files with 9 additions and 0 deletions

View File

@ -50,6 +50,15 @@ class Server(BaseServer):
await self.send(build("JOIN", [c.strip("!")]))
self.chans_actual.append(c.strip("!"))
if line.command == "PRIVMSG" and line.params[0] == self.nickname:
line.params.pop(0)
nick = line.source.split("!")[0]
text = line.params[0]
if text.startswith("!") and nick in ADMINS:
args = text[1:].split(" ")
asyncio.create_task(self.ac(self.name, args))
return
if line.command == "PRIVMSG" and line.params[0] in self.chans_actual:
chan = line.params.pop(0)
me = False