def msg_parse(msg): global options msg = msg.split(' ') if len(msg) >= 1: for word in msg[0:50]: edit.command_timeout(sender, 1) if word in variable.BANNED_WORDS else viewers.command_null() break msg_join = " ".join(msg) if msg_join.isupper(): if sender not in user_mods: con.send_message("We can hear you just fine @" + sender + ".") if len(sender) > 0: if msg[0] in options: try: options[msg[0]]() except KeyError: try: options[msg[0]](msg[1:50]) except KeyError: try: options[msg[0]](msg[1], msg[2:50]) except KeyError: try: options[msg[0]](msg[1], msg[2], msg[3]) except KeyError: try: options[msg[0]](msg[1], msg[2], msg[3], msg[4]) except KeyError: con.send_message(sender + " - What Command are you using? TypeError - @" + variable.BROADCASTER) elif msg[0] in options_pass: msg_parse_case(msg)
def msg_parse_editor(msg): global options_editor msg = msg.split(' ') for word in msg[0:50]: if word.lower() in variable.BANNED_WORDS: con.send_message(str(variable.BANNED_WORDS)) if len(msg) >= 1: if len(sender) > 0: if msg[0] in options_editor: try: options_editor[msg[0]]() except TypeError: try: options_editor[msg[0]](msg[1:50]) except TypeError: try: options_editor[msg[0]](msg[1], msg[2:50]) except TypeError: try: options_editor[msg[0]](msg[1], msg[2], msg[3]) except TypeError: try: options_editor[msg[0]](msg[1], msg[2], msg[3], msg[4]) except TypeError: con.send_message(sender + " - What Command are you using? TypeError - @" + variable.BROADCASTER) elif msg[0] in options_pass: msg_parse_case(msg)
def msg_parse_case(msg): if msg[0] == '!help': viewers.command_help(sender, user_mods) elif msg[0] == '!run': viewers.command_run(mods.run) elif msg[0] == '!stats': viewers.command_stats(sender) elif msg[0] == '!uptime': viewers.command_uptime(start) elif msg[0] == '!purchase': con.send_message('Purchase is currently disabled.')
def startup(): con.send_pass(variable.PASS) con.send_nick(variable.NICK) con.join_channel(variable.CHAN) background.command_start_all() print("") print("-- BOT: Version 1.5") print("-- BOT: Connected and Ready.") print("") print(" Running Updates...") update() print(" Updates Finished") print(" Current moderators: " + str(user_mods)) print("") con.send_message(" Connected to " + variable.USER + ".") edit.editor_command() mods.mod_commands() viewers.viewer_commands()
def msg_parse_mod(msg): msg = msg.split(' ') global options_mod if len(msg) >= 1: if len(sender) > 0: if msg[0] in options_mod: try: options_mod[msg[0]]() except TypeError: try: options_mod[msg[0]](msg[1:50]) except TypeError: try: options_mod[msg[0]](msg[1], msg[2:50]) except TypeError: try: options_mod[msg[0]](msg[1], msg[2], msg[3]) except TypeError: try: options_mod[msg[0]](msg[1], msg[2], msg[3], msg[4]) except TypeError: con.send_message(sender + " - What Command are you using? TypeError - @" + variable.BROADCASTER) elif msg[0] in options_pass: msg_parse_case(msg)