Browse Source

Fix !mp help

master
Giuseppe Guerra 1 month ago
parent
commit
5f4c4a7c28
2 changed files with 2 additions and 13 deletions
  1. +2
    -2
      plugins/multiplayer.py
  2. +0
    -11
      singletons/bot.py

+ 2
- 2
plugins/multiplayer.py View File

@@ -355,8 +355,8 @@ async def score_v(match_id: int, v: int) -> str:
@plugins.base.base
async def help_() -> str:
cmd_list = '|'.join(
k[len("mp "):] + (f" (alias of {v.root_name})" if issubclass(type(v), plugins.base.CommandAlias) else "")
for k, v in bot.get_commands_with_prefix('mp')
k + (f" (alias of {v.root_name})" if issubclass(type(v), plugins.base.CommandAlias) else "")
for k, v in bot.command_handlers["mp"].items()
)
return f"Supported subcommands: !mp <{cmd_list}>"



+ 0
- 11
singletons/bot.py View File

@@ -260,17 +260,6 @@ class Bot:
# Always return original
return functools.partial(func, command_name=command_name)

def get_commands_with_prefix(self, prefix: str) -> Iterator[Tuple[str, plugins.base.Command]]:
"""
Returns a list with all commands that start with a specific prefix.

:param prefix: the prefix, not including the bot prefix. eg: 'mp'
:return: a list of all commands that start with that prefix
"""
for k, v in self.command_handlers.items():
if k.startswith(prefix):
yield k, v

def reset(self) -> None:
"""
Resets the bot. Must be called when reconnecting.


Loading…
Cancel
Save