mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-10 21:50:59 -05:00
test
This commit is contained in:
parent
cb0b0dce45
commit
a97afcd9ff
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user