Tried to add bug detection.

This commit is contained in:
Christian P. MOMON 2020-07-04 18:24:58 +02:00 committed by root
parent 2de7d495d3
commit 2d11e3ad35

View File

@ -170,10 +170,13 @@ class Bot(object):
# them to the console. This function will be run in a thread, see below. # them to the console. This function will be run in a thread, see below.
def msg_handler(self): # pragma: no cover (this excludes this function from testing) def msg_handler(self): # pragma: no cover (this excludes this function from testing)
new_msg = self.ircsock.recv(2048) # receive data from the server new_msg = self.ircsock.recv(2048) # receive data from the server
new_msg = new_msg.strip('\n\r') # removing any unnecessary linebreaks if not new_msg:
print "Empty recv."
if new_msg != '' and new_msg.find("PING :") == -1: new_msg=''
print(datetime.datetime.now().isoformat() + " " + new_msg) else:
new_msg = new_msg.strip('\n\r') # removing any unnecessary linebreaks
if new_msg != '' and new_msg.find("PING :") == -1:
print(datetime.datetime.now().isoformat() + " " + new_msg)
return new_msg return new_msg
# Checks for messages. # Checks for messages.