This commit is contained in:
deathbybandaid 2022-02-12 15:29:44 -05:00
parent 95f2bbc14d
commit 736299974c

View File

@ -1,5 +1,5 @@
import collections import itertools
from sopel import plugin from sopel import plugin
@ -17,13 +17,20 @@ def sb_test_commands(bot, trigger):
@plugin.nickname_command('command_groups') @plugin.nickname_command('command_groups')
def sb_test_command_groups(bot, trigger): def sb_test_command_groups(bot, trigger):
for plugin_name, cmds in collections.OrderedDict(sorted(bot.command_groups.items())).items(): plugin_commands = itertools.chain(
bot.say(plugin_name) bot._rules_manager.get_all_commands(),
bot.say(str(cmds)) bot._rules_manager.get_all_nick_commands(),
cmds = set(cmds) # remove duplicates )
bot.say(str(cmds)) result = {}
cmds = ' '.join(cmds)
bot.say(str(cmds)) for plugin_name, commands in plugin_commands:
if plugin_name not in result:
result[plugin_name] = list(sorted(commands.keys()))
else:
result[plugin_name].extend(commands.keys())
result[plugin_name] = list(sorted(result[plugin_name]))
bot.say(str(result))
# sb.osd(msgs, trigger.sender) # sb.osd(msgs, trigger.sender)