diff --git a/src/pluralkit/bot/commands/member_commands.py b/src/pluralkit/bot/commands/member_commands.py index 823c2d9c..b9406ceb 100644 --- a/src/pluralkit/bot/commands/member_commands.py +++ b/src/pluralkit/bot/commands/member_commands.py @@ -45,11 +45,9 @@ async def specific_member_root(ctx: CommandContext): await member_birthdate(ctx, member) elif ctx.match("delete") or ctx.match("remove") or ctx.match("destroy") or ctx.match("erase"): await member_delete(ctx, member) - elif ctx.match("help"): - await ctx.reply(help.member_commands) else: raise CommandError( - "Unknown subcommand {}. For a list of all commands, type `pk;member help`".format(ctx.pop_str())) + "Unknown subcommand {}. For a list of all commands, type `pk;help member`".format(ctx.pop_str())) else: # Basic lookup await member_info(ctx, member) diff --git a/src/pluralkit/bot/commands/misc_commands.py b/src/pluralkit/bot/commands/misc_commands.py index 5ca2c5c3..e8bd7a33 100644 --- a/src/pluralkit/bot/commands/misc_commands.py +++ b/src/pluralkit/bot/commands/misc_commands.py @@ -3,17 +3,22 @@ import json import os from discord.utils import oauth_url +from bot.embeds import help_footer_embed from pluralkit.bot import help from pluralkit.bot.commands import * async def help_root(ctx: CommandContext): if ctx.match("commands"): - await ctx.reply(help.all_commands) + await ctx.reply(help.all_commands, embed=help_footer_embed()) elif ctx.match("proxy"): - await ctx.reply(help.proxy_guide) + await ctx.reply(help.proxy_guide, embed=help_footer_embed()) + elif ctx.match("system"): + await ctx.reply(help.system_commands, embed=help_footer_embed()) + elif ctx.match("member"): + await ctx.reply(help.system_commands, embed=help_footer_embed()) else: - await ctx.reply(help.root) + await ctx.reply(help.root, embed=help_footer_embed()) async def invite_link(ctx: CommandContext): diff --git a/src/pluralkit/bot/commands/switch_commands.py b/src/pluralkit/bot/commands/switch_commands.py index 78629c9a..f80755d1 100644 --- a/src/pluralkit/bot/commands/switch_commands.py +++ b/src/pluralkit/bot/commands/switch_commands.py @@ -1,9 +1,9 @@ -import dateparser from datetime import datetime from typing import List +import dateparser + import pluralkit.utils -from pluralkit.bot import help from pluralkit.bot.commands import * from pluralkit.member import Member from pluralkit.utils import display_relative @@ -11,7 +11,7 @@ from pluralkit.utils import display_relative async def switch_root(ctx: CommandContext): if not ctx.has_next(): - raise CommandError("You must use a subcommand. For a list of subcommands, type `pk;switch help`.") + raise CommandError("You must use a subcommand. For a list of subcommands, type `pk;help member`.") if ctx.match("out"): await switch_out(ctx) @@ -19,8 +19,6 @@ async def switch_root(ctx: CommandContext): await switch_move(ctx) elif ctx.match("delete") or ctx.match("remove") or ctx.match("erase") or ctx.match("cancel"): await switch_delete(ctx) - elif ctx.match("help"): - await ctx.reply(help.member_commands) else: await switch_member(ctx) diff --git a/src/pluralkit/bot/commands/system_commands.py b/src/pluralkit/bot/commands/system_commands.py index ede7a2cf..ad68b05a 100644 --- a/src/pluralkit/bot/commands/system_commands.py +++ b/src/pluralkit/bot/commands/system_commands.py @@ -1,9 +1,9 @@ -import dateparser -import humanize from datetime import datetime, timedelta +import dateparser +import humanize + import pluralkit.bot.embeds -from pluralkit.bot import help from pluralkit.bot.commands import * from pluralkit.errors import ExistingSystemError, UnlinkingLastAccountError, AccountAlreadyLinkedError from pluralkit.utils import display_relative @@ -29,8 +29,6 @@ async def system_root(ctx: CommandContext): await system_fronthistory(ctx, await ctx.ensure_system()) elif ctx.match("frontpercent") or ctx.match("frontbreakdown") or ctx.match("frontpercentage"): await system_frontpercent(ctx, await ctx.ensure_system()) - elif ctx.match("help"): - await ctx.reply(help.system_commands) elif ctx.match("set"): await system_set(ctx) elif not ctx.has_next(): @@ -48,7 +46,7 @@ async def specified_system_root(ctx: CommandContext): system = await utils.get_system_fuzzy(ctx.conn, ctx.client, system_name) if not system: raise CommandError( - "Unable to find system `{}`. If you meant to run a command, type `pk;system help` for a list of system commands.".format( + "Unable to find system `{}`. If you meant to run a command, type `pk;help system` for a list of system commands.".format( system_name)) if ctx.match("front") or ctx.match("fronter"): diff --git a/src/pluralkit/bot/embeds.py b/src/pluralkit/bot/embeds.py index 4ab8ccb0..152daf42 100644 --- a/src/pluralkit/bot/embeds.py +++ b/src/pluralkit/bot/embeds.py @@ -237,3 +237,9 @@ async def message_card(client: discord.Client, message: db.MessageInfo): embed.set_author(name=message.name, icon_url=message.avatar_url or discord.Embed.Empty) return embed + + +def help_footer_embed() -> discord.Embed: + embed = discord.Embed() + embed.set_footer(text="By @Ske#6201 | GitHub: https://github.com/xSke/PluralKit/") + return embed diff --git a/src/pluralkit/bot/help.py b/src/pluralkit/bot/help.py index 22b28f72..176cd0ba 100644 --- a/src/pluralkit/bot/help.py +++ b/src/pluralkit/bot/help.py @@ -1,5 +1,6 @@ system_commands = """ **System commands** +Commands for adding, removing, editing, and linking systems, as well as querying fronter and front history. ``` pk;system [system] pk;system new [system name @@ -18,6 +19,7 @@ pk;unlink member_commands = """ **Member commands** +Commands for adding, removing, and modifying members, as well as adding, removing and moving switches. ``` pk;member new pk;member @@ -36,6 +38,16 @@ pk;switch delete ``` """.strip() +help_commands = """ +**Help commands** +``` +pk;help +pk;help commands +pk;help system +pk;help member +pk;help proxy +```""".strip() + other_commands = """ **Other commands** ``` @@ -61,7 +73,8 @@ all_commands = """ {} {} {} -""".strip().format(system_commands, member_commands, other_commands, command_notes) +{} +""".strip().format(system_commands, member_commands, help_commands, other_commands, command_notes) proxy_guide = """ **Proxying**