def closed(self, code, reason): if (code != 1000): Logger.writeLine('Connection with Twitch-IRC was lost. Trying to reconnect...') else: Logger.debugLine('Disconnected from Twitch-IRC.') # Try to connect again. self.init(self, self.lurkbot) self.connect() Logger.debugLine('Disconnected: [' + str(code) + '] [' + str(reason) + ']')
def run(self): while not self.killed: try: line = input() if (line == 'exit'): sys.exit(1) sleep(0.02) except Exception as ex: Logger.debugLine(ex)
def sendRaw(self, message): Logger.debugLine('[RAW] ' + message) self.send(message)
def _userstate(self, lurkbot, connection, channel, username, message, tags): Logger.debugLine('[USERSTATE] [' + channel + '] ' + ( 'user' if len(tags['user-type']) == 0 else tags['user-type']))
def _roomstate(self, lurkbot, connection, channel, username, message, tags): Logger.debugLine('[ROOMSTATE] [' + channel + '] [' + username + '] ' + str(tags))