Compare commits

..

No commits in common. "main" and "4ed3c6bdd8b57a59f8fc3d7d1db04c785144fb27" have entirely different histories.

11
bam.py
View file

@ -20,10 +20,6 @@ class Server(BaseServer):
self.__getattribute__("on_" + line.command.lower())(line)
)
# disable automatic WHOing
async def _next_who(self):
pass
async def line_send(self, line):
print(f"{self.name} > {line.format()}")
@ -37,9 +33,8 @@ class Server(BaseServer):
if line.params[1] in self.isoper:
self.isoper.remove(line.params[1])
return
await self.send_raw(KILL.format(line.params[1]))
await self.send_raw(BADLINE.format(line.params[2].split()[3]))
await self.send_raw(BADLINE.format(line.params[2].split()[4]))
await self.send_raw(KILL.format(line.params[1]))
async def on_privmsg(self, line):
nick = line.hostmask.nickname
@ -56,14 +51,10 @@ class Server(BaseServer):
self.log[nick].pop(0)
return
channels = []
for msg in self.log[nick][:-1]:
channels.append(msg[1])
if msg[2] != line.params[1]:
return
if len(set(channels)) < 2:
return
await self.send(build("WHOIS",[nick,nick]))
await self.send_raw(LOG.format(nick,','.join(set([ln[1] for ln in self.log[nick]]))))