This commit is contained in:
deathbybandaid 2019-06-25 12:32:49 -04:00
parent fc719b6ee0
commit 046d9f7be0
2 changed files with 9 additions and 5 deletions

View File

@ -58,11 +58,13 @@ class BotCommands():
self.dict['nickrules'].append(command)
def find_command_type(self, command):
for commandstype in list(self.dict['commands'].keys()):
if commandstype not in ['rule']:
for com in list(self.dict['commands'][commandstype].keys()):
if com.lower() == command.lower():
return commandstype
commandtype_list = list(self.dict['commands'].keys())
if 'rule' in commandtype_list:
commandtype_list.remove('rule')
for commandstype in commandtype_list:
for com in list(self.dict['commands'][commandstype].keys()):
if com.lower() == command.lower():
return commandstype
return None
def get_commands_disabled(self, channel):

View File

@ -28,9 +28,11 @@ def prerun(t_command_type='module'):
# Primary command used for trigger, and a list of all words
trigger_args, trigger_command = make_trigger_args(trigger.args[1], trigger_command_type)
bot.say(str(trigger_command_type))
trigger_command_type = botcommands.find_command_type(trigger_command)
if not trigger_command_type:
return
bot.say(str(trigger_command_type))
for comtype in [trigger_command_type, t_command_type]: