Skip to content

Commit

Permalink
Fix the bot import and logger level
Browse files Browse the repository at this point in the history
  • Loading branch information
optimumtact committed Mar 20, 2016
1 parent c533a17 commit cf0548c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bot/minibot.py
Expand Up @@ -9,13 +9,14 @@
import socket
import sys
import threading
import logger
import logging

logging.basicConfig(level=logging.INFO)
global irc


def print_err(msg):
logger.error(msg)
logging.error(msg)


def setup_irc_socket():
Expand Down Expand Up @@ -61,7 +62,7 @@ def nudge_handler():
rawdata = s.recv(1024)
s.close()
data = pickle.loads(rawdata)
logger.info(data)
logging.info(data)
if data["ip"][0] == "#":
message = "{0} :AUTOMATIC ANNOUNCEMENT : {1}\r\n".format(data["ip"], str(" ".join(data["data"])))
else:
Expand All @@ -80,7 +81,7 @@ def irc_handler():
try:
buf = irc.recv(1024).decode("UTF-8").split("\n")
for i in buf:
logger.info(i)
logging.info(i)
if i[0:4] == "PING":
irc.send(bytes("PONG {0}\r\n".format(i[5:]), "UTF-8"))
else:
Expand Down

0 comments on commit cf0548c

Please sign in to comment.