mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
test
This commit is contained in:
parent
107b18d76e
commit
a88e008b0f
@ -40,7 +40,7 @@ class Search():
|
|||||||
if apikey:
|
if apikey:
|
||||||
self.valid_api[search_api]["apikey"] = apikey
|
self.valid_api[search_api]["apikey"] = apikey
|
||||||
|
|
||||||
self.valid_api[search_api]["comtype"] = "gif_prefix"
|
self.valid_api[search_api]["comtype"] = "search_prefix"
|
||||||
self.valid_api[search_api]["validcoms"] = [self.valid_api[search_api]["filename"]]
|
self.valid_api[search_api]["validcoms"] = [self.valid_api[search_api]["filename"]]
|
||||||
botcommands.register(self.valid_api[search_api])
|
botcommands.register(self.valid_api[search_api])
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,30 @@ def search_main(bot, trigger, botcom):
|
|||||||
bot.osd(["[Information search for '" + str(searchterm) + "']", str(searchreturn)])
|
bot.osd(["[Information search for '" + str(searchterm) + "']", str(searchreturn)])
|
||||||
|
|
||||||
|
|
||||||
|
@SpiceBot.prerun('module', "search_prefix")
|
||||||
|
@sopel.module.commands('(.*)')
|
||||||
|
def gifapi_triggers(bot, trigger, botcom):
|
||||||
|
|
||||||
|
if botcom.dict['com'] not in list(SpiceBot.search.valid_api.keys()):
|
||||||
|
return
|
||||||
|
|
||||||
|
searchterm = spicemanip(botcom.dict['args'], 0) or None
|
||||||
|
if not searchterm:
|
||||||
|
SpiceBot.messagelog.messagelog_error(botcom.dict["log_id"], "Not sure what you want me to look for.")
|
||||||
|
return
|
||||||
|
|
||||||
|
searchdict = {
|
||||||
|
"query": searchterm,
|
||||||
|
"query_type": botcom.dict["realcom"],
|
||||||
|
}
|
||||||
|
|
||||||
|
searchreturn = SpiceBot.search.search(searchdict)
|
||||||
|
if not searchreturn:
|
||||||
|
SpiceBot.messagelog.messagelog_error(botcom.dict["log_id"], 'I cannot find anything about that')
|
||||||
|
else:
|
||||||
|
bot.osd(["[" + botcom.dict["realcom"].upper() + " search for '" + str(searchterm) + "']", str(searchreturn)])
|
||||||
|
|
||||||
|
|
||||||
@SpiceBot.prerun('module')
|
@SpiceBot.prerun('module')
|
||||||
@sopel.module.commands("where", "whereis")
|
@sopel.module.commands("where", "whereis")
|
||||||
def search_where(bot, trigger, botcom):
|
def search_where(bot, trigger, botcom):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user