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
@ -17,13 +17,20 @@ def sb_test_commands(bot, trigger):
@plugin.nickname_command('command_groups')
def sb_test_command_groups(bot, trigger):
for plugin_name, cmds in collections.OrderedDict(sorted(bot.command_groups.items())).items():
bot.say(plugin_name)
bot.say(str(cmds))
cmds = set(cmds) # remove duplicates
bot.say(str(cmds))
cmds = ' '.join(cmds)
bot.say(str(cmds))
plugin_commands = itertools.chain(
bot._rules_manager.get_all_commands(),
bot._rules_manager.get_all_nick_commands(),
)
result = {}
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)