From 28d910c095864c73389590f4915a6de80dcff7d1 Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Tue, 7 Nov 2023 07:59:01 -0600 Subject: [PATCH] Forgot PING of all things. --- bot.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 2225522..4d5076a 100644 --- a/bot.py +++ b/bot.py @@ -117,6 +117,11 @@ class bot: self.channels[chan] = 0 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: return self.sock.send(bytes(command)) @@ -204,7 +209,7 @@ class bot: raw = self.recv() ircmsg = raw.decode() if ircmsg == "": - exit("Probably a netsplit") + self.exit("Probably a netsplit") else: print(raw.lazy_decode(), sep="\n") action = "Unknown"