test
This commit is contained in:
parent
57401396e6
commit
3e3eb2af77
@ -1,6 +1,5 @@
|
||||
|
||||
import collections
|
||||
import textwrap
|
||||
|
||||
from sopel import plugin
|
||||
|
||||
@ -20,17 +19,14 @@ def sb_test_command_groups(bot, trigger):
|
||||
|
||||
msgs = []
|
||||
|
||||
name_length = max(6, max(len(k) for k in bot.command_groups.keys()))
|
||||
for category, cmds in collections.OrderedDict(sorted(bot.command_groups.items())).items():
|
||||
category = category.upper().ljust(name_length)
|
||||
bot.say(category)
|
||||
cmds = set(cmds) # remove duplicates
|
||||
cmds = ' '.join(cmds)
|
||||
msg = category + ' ' + cmds
|
||||
indent = ' ' * (name_length + 2)
|
||||
# Honestly not sure why this is a list here
|
||||
msgs.append('\n'.join(textwrap.wrap(msg, subsequent_indent=indent)))
|
||||
msgs.append(msg)
|
||||
|
||||
sb.osd(msgs, trigger.sender)
|
||||
# sb.osd(msgs, trigger.sender)
|
||||
|
||||
|
||||
@prerun()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user