diff --git a/sopel_modules/SpiceBot_AI/AI_aiml.py b/sopel_modules/SpiceBot_AI/AI_aiml.py index a9c3679..6427b2d 100644 --- a/sopel_modules/SpiceBot_AI/AI_aiml.py +++ b/sopel_modules/SpiceBot_AI/AI_aiml.py @@ -22,7 +22,8 @@ def bot_command_rule(bot, trigger): return message = trigger.args[1] - message = return_utf(message) + if isinstance(message, unicode): + return # ignore text coming from a valid prefix if str(message).startswith(tuple(bot.config.core.prefix_list)): @@ -87,20 +88,3 @@ def bot_command_rule(bot, trigger): else: bot.osd("I don't know what you are asking me to do!") return - - -def return_utf(s): - if isinstance(s, str): - return s.encode('utf-8') - if isinstance(s, (int, float, complex)): - return str(s).encode('utf-8') - try: - return s.encode('utf-8') - except TypeError: - try: - return str(s).encode('utf-8') - except AttributeError: - return s - except AttributeError: - return s - return s # assume it was already utf-8