def pmhook(word, word_eol, userdata): nick = re.sub(cstrip, "", word[0]) message = re.sub(cstrip, "", word[1]) mb.execute(message, nick, nick) return None def cmhook(word, word_eol, userdata): nick = re.sub(cstrip, "", word[0]) message = re.sub(cstrip, "", word[1]) mb.execute(message, nick, "") return None def hook_auth(word, word_eol, userdata): nick = re.sub(cstrip, "", word[0]) message = re.sub(cstrip, "", word[1]) if nick.upper() == "NICKSERV": mb.handle_auth(message) return None mbot = mb(True) print(str(len(mb.commands))) hexchat.hook_print('Notice', hook_auth) hexchat.hook_print('Private Message to Dialog', pmhook) hexchat.hook_print('Private Message', pmhook) hexchat.hook_print('Channel Message', cmhook) hexchat.hook_print('Channel Msg Hilight', cmhook)
def cmhook(word,word_eol,userdata): nick=re.sub(cstrip,"",word[0]) message=re.sub(cstrip,"",word[1]) mb.execute(message,nick,"") return None def hook_auth(word,word_eol,userdata): nick=re.sub(cstrip,"",word[0]) message=re.sub(cstrip,"",word[1]) if nick.upper()=="NICKSERV": mb.handle_auth(message) return None mbot = mb(True) print(str(len(mb.commands))) hexchat.hook_print('Notice',hook_auth) hexchat.hook_print('Private Message to Dialog',pmhook) hexchat.hook_print('Private Message',pmhook) hexchat.hook_print('Channel Message',cmhook) hexchat.hook_print('Channel Msg Hilight',cmhook)
modnames = [ "mbcolor", "mbcommands", "mbtranslation", "mbbing", "mbwhow", #"mbquiz", #"mbconvert", "mbquotes", "mbmisc", #"mbcalc", #"mbupdates", "mbgifs", "mbinterview", "mbrecognition", "mbpassive", "mbwiki", "mburban", "mbdictionary", "mbweather", ] for module in modnames: load(module) if __name__ == "__main__": #logging.basicConfig(filename="murder.log", level=logging.DEBUG) mbot = mb() print("{} commands".format(len(mb.commands))) mbot.start()
modnames=[ "mbcolor", "mbcommands", "mbtranslation", "mbbing", "mbwhow", #"mbquiz", #"mbconvert", "mbquotes", "mbmisc", #"mbcalc", #"mbupdates", "mbgifs", "mbinterview", "mbrecognition", "mbpassive", "mbwiki", "mburban", "mbdictionary", "mbweather", ] for module in modnames: load(module) if __name__=="__main__": #logging.basicConfig(filename="murder.log", level=logging.DEBUG) mbot = mb() print("{} commands".format(len(mb.commands))) mbot.start()