[Help command] Utilize copy to clipboard (#6244)

Co-authored-by: Kreusada Ignad Amredes <67752638+Kreusada@users.noreply.github.com>
This commit is contained in:
TrustyJAID 2024-12-23 19:23:26 -07:00 committed by GitHub
parent 18614b1604
commit fdaa869130
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -352,11 +352,10 @@ class RedHelpFormatter(HelpFormatterABC):
description = command.description or "" description = command.description or ""
tagline = self.format_tagline(ctx, help_settings.tagline) or self.get_default_tagline(ctx) tagline = self.format_tagline(ctx, help_settings.tagline) or self.get_default_tagline(ctx)
signature = _("Syntax: {command_signature}").format( signature = self.get_command_signature(ctx, command)
command_signature=self.get_command_signature(ctx, command)
)
aliases = command.aliases aliases = command.aliases
sig_description = bold(_("Syntax:\n")) + box(signature)
if help_settings.show_aliases and aliases: if help_settings.show_aliases and aliases:
alias_fmt = _("Aliases") if len(command.aliases) > 1 else _("Alias") alias_fmt = _("Aliases") if len(command.aliases) > 1 else _("Alias")
aliases = sorted(aliases, key=len) aliases = sorted(aliases, key=len)
@ -386,7 +385,7 @@ class RedHelpFormatter(HelpFormatterABC):
aliases_content = _("{aliases} and one more alias.").format( aliases_content = _("{aliases} and one more alias.").format(
aliases=aliases_formatted_list aliases=aliases_formatted_list
) )
signature += f"\n{alias_fmt}: {aliases_content}" sig_description += bold(f"{alias_fmt}:") + box(f"{aliases_content}")
subcommands = None subcommands = None
if hasattr(command, "all_commands"): if hasattr(command, "all_commands"):
@ -400,7 +399,7 @@ class RedHelpFormatter(HelpFormatterABC):
emb["embed"]["title"] = f"*{description[:250]}*" emb["embed"]["title"] = f"*{description[:250]}*"
emb["footer"]["text"] = tagline emb["footer"]["text"] = tagline
emb["embed"]["description"] = box(signature) emb["embed"]["description"] = sig_description
command_help = command.format_help_for_context(ctx) command_help = command.format_help_for_context(ctx)
if command_help: if command_help: