From cedabdaffc40e4f87b3e5ca36d49ff1562967aa0 Mon Sep 17 00:00:00 2001 From: Dastan-glitch Date: Mon, 19 Dec 2022 14:00:28 +0300 Subject: [PATCH] fix a attribute error in when sending pong msg --- bin/ircd/script/bots/irc.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/ircd/script/bots/irc.py b/bin/ircd/script/bots/irc.py index 8ed6ea34d..5bd517cd5 100644 --- a/bin/ircd/script/bots/irc.py +++ b/bin/ircd/script/bots/irc.py @@ -19,18 +19,17 @@ class IRC: # Perform user authentication self.irc.send(bytes("USER " + botnick + " " + botnick +" " + botnick + " :python\n", "UTF-8")) self.irc.send(bytes("NICK " + botnick + "\n", "UTF-8")) - # time.sleep(5) # join the channel for chan in channels: self.irc.send(bytes("JOIN " + chan + "\n", "UTF-8")) def get_response(self): - # time.sleep(1) # Get the response resp = self.irc.recv(2040).decode("UTF-8") + msg = resp.split(':')[-1] if resp.find('PING') != -1: - self.irc.send(bytes('PONG ' + resp.split().decode("UTF-8") [1] + '\r\n', "UTF-8")) + self.irc.send(bytes('PONG ' + msg + '\r\n', "UTF-8")) return resp