diff options
Diffstat (limited to 'IRC.py')
-rw-r--r-- | IRC.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/IRC.py b/IRC.py index a67e65d..90ef1fa 100644 --- a/IRC.py +++ b/IRC.py @@ -92,14 +92,17 @@ class IRCBot: self.send_cmd(usermsg) nickmsg = irctokens.build("NICK", [botnick]) self.send_cmd(nickmsg) + def get_response(self): # Get the response resp = self.irc.recv(4096).decode("UTF-8") msg = parsemsg(resp) nwmsg = irctokens.tokenise(resp) - + printred(nwmsg.command) if nwmsg.command == "001": self.on_welcome(nwmsg.params) + if nwmsg.command == "ERROR": + raise IRCError(str(nwmsg.params[0])) if nwmsg.command == 'PING': print('Sending pong') self.irc.send( |