From e3a3c9773cef6e7265e82d63c02b9a71edb6332b Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Fri, 20 Sep 2019 15:11:45 -0400 Subject: [PATCH] update read --- sopel_modules/SpiceBot/Read.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sopel_modules/SpiceBot/Read.py b/sopel_modules/SpiceBot/Read.py index 8014766..2fda138 100644 --- a/sopel_modules/SpiceBot/Read.py +++ b/sopel_modules/SpiceBot/Read.py @@ -283,13 +283,25 @@ class BotRead(): # check that type is set, use cases will inherit this if not set if "type" not in list(dict_from_file.keys()): - dict_from_file["type"] = 'module' + dict_from_file["type"] = dict_from_file["foldername"] dict_from_file["nonstockoptions"] = ["?default"] for command in list(dict_from_file.keys()): if command not in prerun_shared.stockoptions: dict_from_file["nonstockoptions"].append(command) + ignorelist = [] + if dict_from_file["type"] == "SpiceBot_Gif": + ignorelist.extend(["url", "query", "limit", "id", "api_id", "key", "nsfw", "sfw", "sfw", "results", "cururl", "additional_url"]) + elif dict_from_file["type"] == "SpiceBot_Search": + ignorelist.extend(["url", "query", "additional_url"]) + elif dict_from_file["type"] == "SpiceBot_Sherlock": + ignorelist.extend(["url", "errorType", "errorMsg", "noPeriod", "errorUrl"]) + + for ignoreitem in ignorelist: + if ignoreitem in dict_from_file["nonstockoptions"]: + dict_from_file["nonstockoptions"].remove(ignoreitem) + for specialcase in dict_from_file["nonstockoptions"]: # All of the above need to be in the dict if not