def run(self):
     self.ircSocket.send(('JOIN ' + self.channel + '\r\n').encode("utf8"))
     while self.running:
         line = self.queue.get()
         line = str.rstrip(line)
         line = str.split(line)
         if (line[0] == "EXITTHREAD"):
             self.close()
         if (line[0] == "OPPONENT"):
             self.check_for_user_command("self", "opp")
         if (line[0] == "TEST"):
             self.test_output()
         if (line[0] == "IWON"):
             self.ircClient.send_private_message_to_IRC("!i won")
         if (line[0] == "ILOST"):
             self.ircClient.send_private_message_to_IRC("!i lost")
         if (line[0] == "CLEAROVERLAY"):
             GameData.clear_overlay_HTML()
         if (
             len(line) >= 4
             and "PRIVMSG" == line[2]
             and "jtv" not in line[0]
         ):
             # call function to handle user message
             self.user_message(line)
import logging

from Classes.COHOpponentBot_GameData import GameData
from Classes.COHOpponentBot_GUI import GUI

# Program Entry Starts here
# Default error logging log file location:
for handler in logging.root.handlers[:]:
    logging.root.removeHandler(handler)

logging.basicConfig(
    format='%(asctime)s (%(threadName)-10s) [%(levelname)s] %(message)s',
    filename='COH_Opponent_Bot.log',
    filemode="w",
    level=logging.INFO)

GameData.clear_overlay_HTML()

main = GUI()