From a97afcd9ffcc150516a6d706f92142bc5c91e0f1 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Wed, 5 Jun 2019 20:01:04 -0400 Subject: [PATCH] test --- sopel_modules/SpiceBot_AI/AI_aiml.py | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) 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