Forgot PING of all things.
This commit is contained in:
parent
26e4bd0789
commit
28d910c095
1 changed files with 6 additions and 1 deletions
7
bot.py
7
bot.py
|
@ -117,6 +117,11 @@ class bot:
|
||||||
self.channels[chan] = 0
|
self.channels[chan] = 0
|
||||||
break
|
break
|
||||||
|
|
||||||
|
def ping(self, ircmsg: str) -> int:
|
||||||
|
pong = f"PONG :{ircmsg.split('PING :')[1]}\n"
|
||||||
|
print(pong, end="")
|
||||||
|
return self.send(pong)
|
||||||
|
|
||||||
def send(self, command: str) -> int:
|
def send(self, command: str) -> int:
|
||||||
return self.sock.send(bytes(command))
|
return self.sock.send(bytes(command))
|
||||||
|
|
||||||
|
@ -204,7 +209,7 @@ class bot:
|
||||||
raw = self.recv()
|
raw = self.recv()
|
||||||
ircmsg = raw.decode()
|
ircmsg = raw.decode()
|
||||||
if ircmsg == "":
|
if ircmsg == "":
|
||||||
exit("Probably a netsplit")
|
self.exit("Probably a netsplit")
|
||||||
else:
|
else:
|
||||||
print(raw.lazy_decode(), sep="\n")
|
print(raw.lazy_decode(), sep="\n")
|
||||||
action = "Unknown"
|
action = "Unknown"
|
||||||
|
|
Loading…
Reference in a new issue