diff options
-rw-r--r-- | client.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/client.py b/client.py index 78fb8dc..d821445 100644 --- a/client.py +++ b/client.py @@ -35,6 +35,8 @@ with open('config.json') as f: jld = f.read() config = json.loads(jld) +NODEAMON = config['nodaemon'] + uds_addr = config['uds'] try: @@ -58,7 +60,7 @@ def uds_thread(in_q): connection.sendall(bytes("ACK" + LINEEND, 'UTF-8')) in_q.put_nowait(data) else: - connection.sendall(bytes("NACK" + LINEEND)) + connection.sendall(bytes("NACK" + LINEEND, 'UTF-8')) continue except Exception as e: logging.exception(str(e)) @@ -127,12 +129,12 @@ def do_main_loop(): r = generate_response(text[0],text[2][1]) if r is not None: irc.send_privmsg(config['channel'],r) - try: - d = q.get_nowait() - irc.send_privmsg(config['channel'], d.decode("UTF-8")) - except Empty: - printred("Empty") - + + if text[1] == "PING": + while not q.empty(): + d = q.get_nowait() + irc.send_privmsg(config['channel'], d.decode("UTF-8")) + except IRCError as e: |