This commit is contained in:
deathbybandaid 2022-02-12 16:21:00 -05:00
parent fa3ab92736
commit eac398b21b
2 changed files with 19 additions and 14 deletions

View File

@ -21,11 +21,25 @@ class Commands():
@property @property
def sopel_nickname_commands(self): def sopel_nickname_commands(self):
return self.bot.rules.get_all_nick_commands() commands_list = []
for plugin_name, commands in self.bot.rules.get_all_nick_commands():
for command in commands.values():
commands_list.append({
"name": command.name,
"aliases": command.aliases,
})
return commands_list
@property @property
def sopel_action_commands(self): def sopel_action_commands(self):
return self.bot.rules.get_all_action_commands() commands_list = []
for plugin_name, commands in self.bot.rules.get_all_action_commands():
for command in commands.values():
commands_list.append({
"name": command.name,
"aliases": command.aliases,
})
return commands_list
def dispatch(self, bot, trigger, trigger_dict): def dispatch(self, bot, trigger, trigger_dict):
if trigger_dict["trigger_type"] == "command": if trigger_dict["trigger_type"] == "command":

View File

@ -56,10 +56,7 @@ def sopel_commands(bot, trigger):
bot.say("testing commands") bot.say("testing commands")
for x in sb.commands.sopel_commands: sb.osd(sb.commands.sopel_commands, trigger.sender)
bot.say(str(x))
for y in x:
bot.say(str(y))
@prerun() @prerun()
@ -67,10 +64,7 @@ def sopel_commands(bot, trigger):
def sopel_nickname_commands(bot, trigger): def sopel_nickname_commands(bot, trigger):
bot.say("testing nickname_commands") bot.say("testing nickname_commands")
for x in sb.commands.sopel_nickname_commands: sb.osd(sb.commands.sopel_nickname_commands, trigger.sender)
bot.say(str(x))
for y in x:
bot.say(str(y))
@prerun() @prerun()
@ -79,7 +73,4 @@ def sopel_action_commands(bot, trigger):
bot.say("testing action_commands") bot.say("testing action_commands")
for x in sb.commands.sopel_action_commands: sb.osd(sb.commands.sopel_action_commands, trigger.sender)
bot.say(str(x))
for y in x:
bot.say(str(y))