def bot_action(x): react = "" bot_log(0, 1, x) x = g_func.clean_for_artha(x) if x == "": x = -1 else: x.decode('utf-8') x = x.lower() for case in g_func.Switch(x): if case(-1): react = "Say something." break if case(): # default reply, omit possible 'if True' react = bot_intellect.bot_interpret(x) if react != -1: bot_output(react) else: return react
def bot_action(x): react = "" bot_log(0, 1, x) if '#artha' not in x: x = bot_intellect.bot_focus(g_func.clean_for_artha(x)) if x == "": x = -1 elif x == "debug:cc": x = 0.0 else: x.decode('utf-8') x = x.lower() if x in bot_cache_in: react = bot_repeat_append(bot_cache_out[bot_cache_in.index(x)]) else: for case in g_func.Switch(x): if case(-1): react = "Say something." break if case(0.0): react = "[admin]: "+str(global_consult.c_count) break if case(): # default reply, omit possible 'if True' react = bot_intellect.bot_interpret(x) if react != -1: if x not in bot_cache_in: bot_cache_in.append(x) if react not in bot_cache_out: bot_cache_out.append(g_func.parse_artha_vars(react)) global_consult.c_count += 1 return bot_output(react) else: return react