Help page updates

This commit is contained in:
Ske 2018-12-10 20:09:35 +01:00
parent be09c87f52
commit 0aa370e549
6 changed files with 36 additions and 18 deletions

View File

@ -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)

View File

@ -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):

View File

@ -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)

View File

@ -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"):

View File

@ -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

View File

@ -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 <member name>
pk;member <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**