Beispiel #1
0
def run_bot():
    import settings
    from handler import Bot

    while True:
        try:
            # initialize
            botko = Bot()
            # and run
            botko.run(settings.IRC_SERVER, settings.IRC_PORT)

        except Exception as e:
            # log the error
            from traceback import format_exc
            from datetime import datetime
            from time import sleep

            print "ERR " + str(format_exc())

            f = open('error_log', 'a')
            f.write(str(datetime.now()) + "\n")
            f.write(str(format_exc() + "\n\n"))
            f.close()
            sleep(10)
Beispiel #2
0
 def setUp(self):
     self.bot = Bot()
     self.logic = BotLogic(self.bot)