mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
test
This commit is contained in:
parent
44e6448b64
commit
e7d9996c64
@ -25,7 +25,6 @@ class BotDictCommands():
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.setup_dictcoms()
|
self.setup_dictcoms()
|
||||||
self.validprefixcoms = []
|
|
||||||
self.header = {'User-Agent': str(UserAgent().chrome)}
|
self.header = {'User-Agent': str(UserAgent().chrome)}
|
||||||
self.valid_com_types = [
|
self.valid_com_types = [
|
||||||
'simple', 'fillintheblank', 'targetplusreason',
|
'simple', 'fillintheblank', 'targetplusreason',
|
||||||
@ -66,7 +65,7 @@ class BotDictCommands():
|
|||||||
if "type" not in list(dict_from_file.keys()) or dict_from_file["type"] not in self.valid_com_types:
|
if "type" not in list(dict_from_file.keys()) or dict_from_file["type"] not in self.valid_com_types:
|
||||||
dict_from_file["type"] = 'simple'
|
dict_from_file["type"] = 'simple'
|
||||||
|
|
||||||
dict_from_file["comtype"] = "prefix_" + dict_from_file["type"]
|
dict_from_file["comtype"] = "prefix" + dict_from_file["type"]
|
||||||
|
|
||||||
# Don't process these.
|
# Don't process these.
|
||||||
keysprocessed = []
|
keysprocessed = []
|
||||||
@ -93,10 +92,6 @@ class BotDictCommands():
|
|||||||
|
|
||||||
botcommands.register(dict_from_file)
|
botcommands.register(dict_from_file)
|
||||||
|
|
||||||
for commandtype in self.valid_com_types:
|
|
||||||
if "prefix_" + commandtype in list(botcommands.dict['commands'].keys()):
|
|
||||||
self.validprefixcoms.extend(list(botcommands.dict['commands']["prefix_" + commandtype].keys()))
|
|
||||||
|
|
||||||
def bot_dict_use_cases(self, maincom, dict_from_file, process_list):
|
def bot_dict_use_cases(self, maincom, dict_from_file, process_list):
|
||||||
|
|
||||||
for mustbe in process_list:
|
for mustbe in process_list:
|
||||||
|
|||||||
@ -14,7 +14,11 @@ import sopel_modules.SpiceBot as SpiceBot
|
|||||||
@sopel.module.commands('(.*)')
|
@sopel.module.commands('(.*)')
|
||||||
def command_dictcom(bot, trigger):
|
def command_dictcom(bot, trigger):
|
||||||
|
|
||||||
if trigger.sb['com'] not in list(SpiceBot.dictcoms.validprefixcoms):
|
if trigger.sb['com'] not in list(SpiceBot.commands.dict['commands']["prefix"].keys()):
|
||||||
return
|
return
|
||||||
|
|
||||||
bot.say("here")
|
# command aliases
|
||||||
|
if "aliasfor" in list(SpiceBot.commands.dict['commands']["prefix"][trigger.sb['com']].keys()):
|
||||||
|
trigger.sb['com'] = SpiceBot.commands.dict['commands']["prefix"][trigger.sb['com']]["aliasfor"]
|
||||||
|
|
||||||
|
bot.say(str(trigger.sb['com']))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user