Remove sleep

trunk
mio 2018-10-10 20:33:06 +00:00
parent edeff5469d
commit 1f49b05e10
1 changed files with 3 additions and 4 deletions

View File

@ -2,7 +2,6 @@ import socket
import yaml import yaml
from random import randint from random import randint
from sys import exit from sys import exit
from time import sleep
class Util: class Util:
@ -49,7 +48,6 @@ class IRC:
for c in self.channels: for c in self.channels:
# Pass in a context dict for handlers # Pass in a context dict for handlers
listen_hook({"msg": self.msg, "listen_chan": c}) listen_hook({"msg": self.msg, "listen_chan": c})
sleep(1)
def connect(self, server, bot_nick): def connect(self, server, bot_nick):
"""Connect to the server and sends user/nick information.""" """Connect to the server and sends user/nick information."""
@ -72,7 +70,8 @@ class IRC:
def keepalive(self, line): def keepalive(self, line):
"""Stay connected to a server by responding to server pings.""" """Stay connected to a server by responding to server pings."""
if resp != []: resp = line
if resp != "":
resp = line.split(" ", 1)[1] resp = line.split(" ", 1)[1]
if ("PING " + resp) in line: if ("PING " + resp) in line:
self.send("PONG", resp) self.send("PONG", resp)
@ -102,7 +101,7 @@ class IRC:
def receive(self): def receive(self):
"""Get messages from the connected socket.""" """Get messages from the connected socket."""
data = self.sock.recv(2040).decode("utf-8").strip("\r\n") data = self.sock.recv(2048).decode("utf-8").strip("\r\n")
if self.debug: if self.debug:
print("[debug][recv] " + data) print("[debug][recv] " + data)
return data return data