This commit is contained in:
deathbybandaid 2022-02-12 16:39:51 -05:00
parent 23211d6590
commit 4ce4b767f1
2 changed files with 2 additions and 37 deletions

View File

@ -16,8 +16,6 @@ class Commands():
commands_list.append({ commands_list.append({
"name": command.name, "name": command.name,
"aliases": command.aliases, "aliases": command.aliases,
"class": str(command.__class__),
"dir": str(dir(command.__class__))
}) })
return commands_list return commands_list
@ -29,7 +27,6 @@ class Commands():
commands_list.append({ commands_list.append({
"name": command.name, "name": command.name,
"aliases": command.aliases, "aliases": command.aliases,
"class": str(command.__class__)
}) })
return commands_list return commands_list
@ -41,7 +38,6 @@ class Commands():
commands_list.append({ commands_list.append({
"name": command.name, "name": command.name,
"aliases": command.aliases, "aliases": command.aliases,
"class": str(command.__class__)
}) })
return commands_list return commands_list

View File

@ -14,40 +14,9 @@ def sb_test_commands(bot, trigger):
bot.say("%s" % trigger.raw) bot.say("%s" % trigger.raw)
@plugin.nickname_command('command_groups') @plugin.nickname_command('plugins')
def sb_test_command_groups(bot, trigger): def sb_test_command_groups(bot, trigger):
bot.say(str(dir(bot._plugins)))
plugin_commands = itertools.chain(
bot.rules.get_all_commands(),
bot.rules.get_all_action_commands(),
bot.rules.get_all_nick_commands(),
)
for plugin_name, commands in plugin_commands:
for command in commands.values():
bot.say(str(command.name))
sb.osd(str(dir(command)), trigger.sender)
return
commands = (
(command, command.get_doc(), command.get_usages())
for plugin_name, commands in plugin_commands
for command in commands.values()
)
for command, doc, usages in commands:
bot.say(str(dir(command)))
return
realcommands = dict(
(name, (doc.splitlines(), [u['text'] for u in usages]))
for command, doc, usages in commands
for name in ((command.name,) + command.aliases)
)
sb.osd(str(realcommands), trigger.sender)
# sb.osd(msgs, trigger.sender)
@prerun() @prerun()