Gif Tweaks

This commit is contained in:
deathbybandaid 2019-05-02 21:09:11 -04:00
parent 86b0f7c91d
commit e0f748d69a
2 changed files with 12 additions and 1 deletions

View File

@ -232,6 +232,16 @@ def query_detection(bot, trigger):
return
def commandsquery_register_type(bot, command_type):
if 'SpiceBot_CommandsQuery' not in bot.memory:
bot.memory['SpiceBot_CommandsQuery'] = dict()
if command_type not in bot.memory['SpiceBot_CommandsQuery'].keys():
bot.memory['SpiceBot_CommandsQuery'][command_type] = dict()
bot.memory['SpiceBot_CommandsQuery'][command_type + "_count"] = 0
bot.memory['SpiceBot_CommandsQuery'][command_type + "_count"] += 1
def commandsquery_register(bot, command_type, validcoms, aliasfor=None):
if not isinstance(validcoms, list):

View File

@ -10,7 +10,7 @@ import sopel_modules.osd
from sopel_modules.SpiceBot_Botevents.BotEvents import set_bot_event, check_bot_events, startup_bot_event
from sopel_modules.SpiceBot_CommandsQuery.CommandsQuery import commandsquery_register
from sopel_modules.SpiceBot_CommandsQuery.CommandsQuery import commandsquery_register, commandsquery_register_type
from sopel_modules.SpiceBot_SBTools import read_directory_json_to_dict, sopel_triggerargs
@ -90,6 +90,7 @@ def setup_thread(bot):
while not check_bot_events(bot, ["SpiceBot_CommandsQuery"]):
pass
commandsquery_register_type(bot, "prefix_command")
for prefix_command in bot.memory["SpiceBot_GifSearch"]['valid_gif_api_dict'].keys():
commandsquery_register(bot, "prefix_command", prefix_command)