From eac398b21bec4057fb3c1bad9dcbeda77e852431 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Sat, 12 Feb 2022 16:21:00 -0500 Subject: [PATCH] test --- .../SBCore/commands/__init__.py | 18 ++++++++++++++++-- .../__init__.py | 15 +++------------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/sopel_SpiceBot_Core_1/SBCore/commands/__init__.py b/sopel_SpiceBot_Core_1/SBCore/commands/__init__.py index 4778b5b..14cd256 100644 --- a/sopel_SpiceBot_Core_1/SBCore/commands/__init__.py +++ b/sopel_SpiceBot_Core_1/SBCore/commands/__init__.py @@ -21,11 +21,25 @@ class Commands(): @property 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 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): if trigger_dict["trigger_type"] == "command": diff --git a/sopel_SpiceBot_Runtime_Nickname_Commands/__init__.py b/sopel_SpiceBot_Runtime_Nickname_Commands/__init__.py index 0e283ff..c02c2f5 100644 --- a/sopel_SpiceBot_Runtime_Nickname_Commands/__init__.py +++ b/sopel_SpiceBot_Runtime_Nickname_Commands/__init__.py @@ -56,10 +56,7 @@ def sopel_commands(bot, trigger): bot.say("testing commands") - for x in sb.commands.sopel_commands: - bot.say(str(x)) - for y in x: - bot.say(str(y)) + sb.osd(sb.commands.sopel_commands, trigger.sender) @prerun() @@ -67,10 +64,7 @@ def sopel_commands(bot, trigger): def sopel_nickname_commands(bot, trigger): bot.say("testing nickname_commands") - for x in sb.commands.sopel_nickname_commands: - bot.say(str(x)) - for y in x: - bot.say(str(y)) + sb.osd(sb.commands.sopel_nickname_commands, trigger.sender) @prerun() @@ -79,7 +73,4 @@ def sopel_action_commands(bot, trigger): bot.say("testing action_commands") - for x in sb.commands.sopel_action_commands: - bot.say(str(x)) - for y in x: - bot.say(str(y)) + sb.osd(sb.commands.sopel_action_commands, trigger.sender)