And nicer looking interactive help menu for discord.py
Project description
discord-pretty-help
An embed version of the built-in help command for discord.py
Inspired by the DefaultHelpCommand that discord.py uses, but revised for embeds and additional sorting on individual pages that can be "scrolled" through.
Installation
pip install discord-pretty-help
Usage
Example of how to use it:
from discord.ext import commands
from pretty_help import PrettyHelp
bot = commands.Bot(command_prefix="!", help_command=PrettyHelp())
Added Optional Args
color
- Set the default embed colordelete_invoke
- Delete the message that invoked the help command. Requires message delete permission. Defaults isFalse
ending_note
- Set the footer of the embed. Ending notes are fed acommands.Context
(ctx
) and aPrettyHelp
(help
) instance for more advanced customization.image_url
- The url of the image to be used on the embedindex_title
- Set the index page name default is "Categories"menu
- The menu to use for navigating pages. Uses apretty_help.PrettyMenu()
instance. Default ispretty_help.AppMenu()
no_category
- Set the name of the page with commands not part of a category. Default is "No Category"paginator
- The paginator to use. One is created by default.send_typing
- A bool that indicates if the bot will send a typing indicator. Defaults toTrue
show_index
- Show the index page or notsort_commands
- Sort commands and categories alphabeticallythumbnail_url
- The url of the thumbnail to be used on the embed
Menus
pretty_help.EmojiMenu
- Uses Emojis to navigate
active_time
- Set the time (in seconds) that the message will be active. Default is 30sdelete_after_timeout
- Delete the message afteractive_time
instead of removing reactions. DefaultFalse
page_left
- The emoji to use to page leftpage_right
- The emoji to use to page rightremove
- The emoji to use to remove the help message
pretty_help.AppMenu
- Uses Application Interactions (buttons) for navigating
timeout
- The duration the interaction will be active for. Defaults toNone
.ephemeral
- Send as an ephemeral message. Defaults toFalse
.
By default, the help will just pick a random color on every invoke. You can change this using the color
argument:
Example of using a different menu and customization:
from discord.ext import commands
from pretty_help import EmojiMenu, PrettyHelp
# ":discord:743511195197374563" is a custom discord emoji format. Adjust to match your own custom emoji.
menu = EmojiMenu(page_left="\U0001F44D", page_right="👎", remove=":discord:743511195197374563", active_time=5)
# Custom ending note
ending_note = "The ending note from {ctx.bot.user.name}\nFor command {help.clean_prefix}{help.invoked_with}"
bot = commands.Bot(command_prefix="!")
bot.help_command = PrettyHelp(menu=menu, ending_note=ending_note)
The basic help
command will break commands up by cogs. Each cog will be a different page. Those pages can be navigated.
Changelog
[2.0.0]
- Subcommands in pages are indicated with a 🔗, previously it was unclear they were sub commands of the page title
- Support Application commands
- Support for GroupCogs
- Navigation using discord interactions e.g. Buttons and select menus
Notes:
- discord.py must already be installed to use this
manage-messages
permission is recommended so reactions can be removed automatically
Forks for other discord.py based libraries (could be out of date):
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file discord_pretty_help-2.0.4.tar.gz
.
File metadata
- Download URL: discord_pretty_help-2.0.4.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.5 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c52f12b62b51f16eb8723b6f7c4dac20c0f6ba0f43a25a6768f63e02426da91 |
|
MD5 | d898ef61ef3b90c4d42e7d5c97767355 |
|
BLAKE2b-256 | 608bbbe593bacd9e56a181f2f10b55174b401581b15863beb712979b2be7f505 |
File details
Details for the file discord_pretty_help-2.0.4-py3-none-any.whl
.
File metadata
- Download URL: discord_pretty_help-2.0.4-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.5 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 802b0d41e933d8840b454ac910eac5998b27c6b3f138956f62b48adeae5ce82e |
|
MD5 | 9b1f3468d52d6db6575c64f7cbef777c |
|
BLAKE2b-256 | 22bec932da3a7cd1139fddd93c817052b52d9339d84ce6d52279a14ef44bd6b3 |