mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 15:09:54 -05:00
better logic
This commit is contained in:
parent
7bbffecd86
commit
b7d5b38a62
@ -302,9 +302,16 @@ def bot_dictcom_search(bot, trigger, botcom):
|
|||||||
else:
|
else:
|
||||||
searchterm = botcom.dict["dict"][botcom.dict["responsekey"]]["responses"]
|
searchterm = botcom.dict["dict"][botcom.dict["responsekey"]]["responses"]
|
||||||
|
|
||||||
if searchterm:
|
|
||||||
searchreturn = SpiceBot.google.search(searchterm)
|
searchreturn = SpiceBot.google.search(searchterm)
|
||||||
|
|
||||||
if not searchreturn:
|
if not searchreturn:
|
||||||
bot.osd('I cannot find anything about that')
|
botcom.dict["success"] = False
|
||||||
|
falimessage = 'I cannot find anything about that'
|
||||||
|
if botcom.dict["dict"][botcom.dict["responsekey"]]["search_fail"]:
|
||||||
|
falimessage = botcom.dict["dict"][botcom.dict["responsekey"]]["search_fail"]
|
||||||
|
botcom.dict["dict"][botcom.dict["responsekey"]]["responses"] = falimessage
|
||||||
else:
|
else:
|
||||||
bot.osd(["[Information search for '" + str(searchterm) + "']", str(searchreturn)])
|
botcom.dict["dict"][botcom.dict["responsekey"]]["responses"] = ["[Information search for '" + str(searchterm) + "']", str(searchreturn)]
|
||||||
|
|
||||||
|
botcom.dict["specified"] = False
|
||||||
|
bot_dictcom_reply_shared(bot, trigger, botcom)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user