test
This commit is contained in:
parent
23211d6590
commit
4ce4b767f1
@ -16,8 +16,6 @@ class Commands():
|
||||
commands_list.append({
|
||||
"name": command.name,
|
||||
"aliases": command.aliases,
|
||||
"class": str(command.__class__),
|
||||
"dir": str(dir(command.__class__))
|
||||
})
|
||||
return commands_list
|
||||
|
||||
@ -29,7 +27,6 @@ class Commands():
|
||||
commands_list.append({
|
||||
"name": command.name,
|
||||
"aliases": command.aliases,
|
||||
"class": str(command.__class__)
|
||||
})
|
||||
return commands_list
|
||||
|
||||
@ -41,7 +38,6 @@ class Commands():
|
||||
commands_list.append({
|
||||
"name": command.name,
|
||||
"aliases": command.aliases,
|
||||
"class": str(command.__class__)
|
||||
})
|
||||
return commands_list
|
||||
|
||||
|
||||
@ -14,40 +14,9 @@ def sb_test_commands(bot, trigger):
|
||||
bot.say("%s" % trigger.raw)
|
||||
|
||||
|
||||
@plugin.nickname_command('command_groups')
|
||||
@plugin.nickname_command('plugins')
|
||||
def sb_test_command_groups(bot, trigger):
|
||||
|
||||
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)
|
||||
bot.say(str(dir(bot._plugins)))
|
||||
|
||||
|
||||
@prerun()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user