Made help command use the invocation prefix

Fixes #338
This commit is contained in:
0x5c 2021-03-13 17:48:18 -05:00
parent 4139b23fe6
commit ab73001340
No known key found for this signature in database
GPG Key ID: A57F71C3176B9581
2 changed files with 5 additions and 5 deletions

View File

@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Renamed `?cond` to `?solar`.
### Fixed
- Weird image caching situation for `?greyline` on Discord's side.
- The help command was not using the prefix it was invoked with.
### Deprecated
- `?ungrid`.
- Deprecated old `?solar` aliases (`?cond`, etc).

View File

@ -18,13 +18,12 @@ import discord.ext.commands as commands
import info
import common as cmn
import data.options as opt
class QrmHelpCommand(commands.HelpCommand):
def __init__(self):
super().__init__(command_attrs={"help": "Shows help about qrm or a command", "aliases": ["h"]})
self.verify_checks = True
self.context: commands.Context
async def get_bot_mapping(self):
bot = self.context.bot
@ -46,9 +45,9 @@ class QrmHelpCommand(commands.HelpCommand):
if parent:
fmt = f"{parent} {fmt}"
alias = fmt
return f"{opt.display_prefix}{alias} {command.signature}\n *Aliases:* {aliases}"
return f"{self.context.prefix}{alias} {command.signature}\n *Aliases:* {aliases}"
alias = command.name if not parent else f"{parent} {command.name}"
return f"{opt.display_prefix}{alias} {command.signature}"
return f"{self.context.prefix}{alias} {command.signature}"
async def send_error_message(self, error):
embed = cmn.embed_factory(self.context)
@ -60,7 +59,7 @@ class QrmHelpCommand(commands.HelpCommand):
async def send_bot_help(self, mapping):
embed = cmn.embed_factory(self.context)
embed.title = "qrm Help"
embed.description = (f"For command-specific help and usage, use `{opt.display_prefix}help [command name]`."
embed.description = (f"For command-specific help and usage, use `{self.context.prefix}help [command name]`."
" Many commands have shorter aliases.")
mapping = await mapping