mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-10 21:50:59 -05:00
more AI
This commit is contained in:
parent
37deaadc8f
commit
985f7b0ada
@ -26,43 +26,6 @@ def bot_command_nick(bot, trigger):
|
||||
|
||||
fulltrigger = spicemanip.main(trigger.sb['args'], 0).lower()
|
||||
|
||||
if fulltrigger.lower().startswith("what is"):
|
||||
searchterm = spicemanip.main(trigger.sb['args'], "3+") or None
|
||||
if searchterm:
|
||||
searchreturn = SpiceBot.googlesearch(searchterm)
|
||||
if not searchreturn:
|
||||
bot.osd('I cannot find anything about that')
|
||||
else:
|
||||
bot.osd(str(searchreturn))
|
||||
else:
|
||||
bot.osd("Do you think this is Jeopardy?")
|
||||
return
|
||||
|
||||
elif fulltrigger.lower().startswith("where is"):
|
||||
searchterm = spicemanip.main(trigger.sb['args'], "3+") or None
|
||||
if searchterm:
|
||||
|
||||
if searchterm.lower() in ['waldo', 'wally']:
|
||||
bot.osd("He is hiding for a reason?")
|
||||
searchreturn = SpiceBot.googlesearch("wimmelbilderbuch")
|
||||
if searchreturn:
|
||||
bot.osd(str(searchreturn))
|
||||
return
|
||||
|
||||
elif searchterm.lower() == 'carmen sandiego':
|
||||
carmenlocale = ['ACME Headquarters', "Villains' International League of Evil"]
|
||||
bot.osd("Currently she is located at " + spicemanip.main(carmenlocale, 'random'))
|
||||
return
|
||||
searchreturn = SpiceBot.googlesearch(searchterm, 'maps')
|
||||
|
||||
if not searchreturn:
|
||||
bot.osd('I cannot find anything about that')
|
||||
else:
|
||||
bot.osd(str(searchreturn))
|
||||
else:
|
||||
bot.osd("Not sure what you want me to look for.")
|
||||
return
|
||||
|
||||
# if fulltrigger.lower().startswith("what time is it"):
|
||||
# TODO
|
||||
|
||||
@ -73,7 +36,7 @@ def bot_command_nick(bot, trigger):
|
||||
# return
|
||||
# TODO
|
||||
|
||||
elif fulltrigger.lower().startswith(tuple(["make me a", "beam me a"])):
|
||||
if fulltrigger.lower().startswith(tuple(["make me a", "beam me a"])):
|
||||
makemea = spicemanip.main(trigger.sb['args'], "4+") or None
|
||||
if makemea:
|
||||
bot.osd("beams " + trigger.nick + " a " + makemea, trigger.sender, 'action')
|
||||
|
||||
@ -44,12 +44,12 @@ def bot_command_rule(bot, trigger):
|
||||
bot.osd(invalid_display, trigger.nick, 'notice')
|
||||
return
|
||||
|
||||
fulltrigger = spicemanip.main(trigger_args, 0)
|
||||
if str(message).lower().startswith(str(bot.nick).lower()):
|
||||
command_type = 'nickname'
|
||||
trigger_args, trigger_command = SpiceBot.prerun.trigger_args(message, 'nickname')
|
||||
if str(trigger_command).startswith("?"):
|
||||
return
|
||||
fulltrigger = spicemanip.main(trigger_args, 0)
|
||||
if fulltrigger in SpiceBot.commands.dict['nickrules']:
|
||||
return
|
||||
if trigger_command in SpiceBot.commands.dict['commands']["nickname"].keys():
|
||||
@ -63,6 +63,20 @@ def bot_command_rule(bot, trigger):
|
||||
bot.osd(str(returnmessage))
|
||||
else:
|
||||
if command_type == 'nickname':
|
||||
|
||||
if fulltrigger.lower().startswith(tuple(["what is", "where is"])):
|
||||
searchterm = spicemanip.main(trigger_args, "3+") or None
|
||||
if searchterm:
|
||||
if trigger_args[0].lower() == "where":
|
||||
searchreturn = SpiceBot.googlesearch(searchterm, 'maps')
|
||||
else:
|
||||
searchreturn = SpiceBot.googlesearch(searchterm)
|
||||
if not searchreturn:
|
||||
bot.osd('I cannot find anything about that')
|
||||
else:
|
||||
bot.osd(str(searchreturn))
|
||||
return
|
||||
|
||||
closestmatches = SpiceBot.similar_list(trigger_command, SpiceBot.commands.dict['commands']["nickname"].keys(), 3, 'reverse')
|
||||
if len(closestmatches):
|
||||
closestmatches = spicemanip.main(closestmatches, "andlist")
|
||||
|
||||
9
sopel_modules/SpiceBot_Configs/aiml/nickname_whatis.aiml
Normal file
9
sopel_modules/SpiceBot_Configs/aiml/nickname_whatis.aiml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<aiml version="1.0">
|
||||
|
||||
<category>
|
||||
<pattern>BOTNICK what is</pattern>
|
||||
<template>Do you think this is Jeopardy?</template>
|
||||
</category>
|
||||
|
||||
</aiml>
|
||||
29
sopel_modules/SpiceBot_Configs/aiml/nickname_whereis.aiml
Normal file
29
sopel_modules/SpiceBot_Configs/aiml/nickname_whereis.aiml
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<aiml version="1.0">
|
||||
|
||||
<category>
|
||||
<pattern>BOTNICK where is waldo</pattern>
|
||||
<template>He is hiding for a reason?</template>
|
||||
</category>
|
||||
|
||||
<category>
|
||||
<pattern>BOTNICK where is wally</pattern>
|
||||
<template>He is hiding for a reason?</template>
|
||||
</category>
|
||||
|
||||
<category>
|
||||
<pattern>BOTNICK where is carmen sandiego</pattern>
|
||||
<template>
|
||||
<random>
|
||||
<li>Currently she is located at ACME Headquarters</li>
|
||||
<li>Currently she is located at Villains' International League of Evil</li>
|
||||
</random>
|
||||
</template>
|
||||
</category>
|
||||
|
||||
<category>
|
||||
<pattern>BOTNICK where is</pattern>
|
||||
<template>Not sure what you want me to look for.</template>
|
||||
</category>
|
||||
|
||||
</aiml>
|
||||
Loading…
Reference in New Issue
Block a user