mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-12 14:39:54 -05:00
bugfix
This commit is contained in:
parent
cf6d431a17
commit
c4027e2c71
@ -28,6 +28,7 @@ def bot_command_rule(bot, trigger):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if str(message).lower().startswith(str(bot.nick).lower()):
|
if str(message).lower().startswith(str(bot.nick).lower()):
|
||||||
|
command_type = 'nickname'
|
||||||
trigger_args, trigger_command = SpiceBot.prerun.trigger_args(message, 'nickname')
|
trigger_args, trigger_command = SpiceBot.prerun.trigger_args(message, 'nickname')
|
||||||
if str(trigger_command).startswith("?"):
|
if str(trigger_command).startswith("?"):
|
||||||
return
|
return
|
||||||
@ -37,17 +38,19 @@ def bot_command_rule(bot, trigger):
|
|||||||
if trigger_command in SpiceBot.commands.dict['commands']["nickname"].keys():
|
if trigger_command in SpiceBot.commands.dict['commands']["nickname"].keys():
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
|
command_type = 'module'
|
||||||
trigger_args, trigger_command = SpiceBot.prerun.trigger_args(message, 'module')
|
trigger_args, trigger_command = SpiceBot.prerun.trigger_args(message, 'module')
|
||||||
|
|
||||||
returnmessage = SpiceBot.botai.on_message(bot, trigger, message)
|
returnmessage = SpiceBot.botai.on_message(bot, trigger, message)
|
||||||
if returnmessage:
|
if returnmessage:
|
||||||
bot.osd(str(returnmessage))
|
bot.osd(str(returnmessage))
|
||||||
else:
|
else:
|
||||||
closestmatches = SpiceBot.similar_list(trigger_command, SpiceBot.commands.dict['commands']["nickname"].keys(), 3, 'reverse')
|
if command_type == 'nickname':
|
||||||
if len(closestmatches):
|
closestmatches = SpiceBot.similar_list(trigger_command, SpiceBot.commands.dict['commands']["nickname"].keys(), 3, 'reverse')
|
||||||
closestmatches = spicemanip.main(closestmatches, "andlist")
|
if len(closestmatches):
|
||||||
bot.osd("I don't know what you are asking me to do! Did you mean: " + str(closestmatches) + "?")
|
closestmatches = spicemanip.main(closestmatches, "andlist")
|
||||||
return
|
bot.osd("I don't know what you are asking me to do! Did you mean: " + str(closestmatches) + "?")
|
||||||
else:
|
return
|
||||||
bot.osd("I don't know what you are asking me to do!")
|
else:
|
||||||
return
|
bot.osd("I don't know what you are asking me to do!")
|
||||||
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user