Skip to main content

And nicer looking interactive help menu for discord.py

Project description

version python

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 color
  • delete_invoke - Delete the message that invoked the help command. Requires message delete permission. Defaults is False
  • ending_note - Set the footer of the embed. Ending notes are fed a commands.Context (ctx) and a PrettyHelp (help) instance for more advanced customization.
  • image_url - The url of the image to be used on the embed
  • index_title - Set the index page name default is "Categories"
  • menu - The menu to use for navigating pages. Uses a pretty_help.PrettyMenu() instance. Default is pretty_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 to True
  • show_index - Show the index page or not
  • sort_commands - Sort commands and categories alphabetically
  • thumbnail_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 30s
  • delete_after_timeout - Delete the message after active_time instead of removing reactions. Default False
  • page_left - The emoji to use to page left
  • page_right - The emoji to use to page right
  • remove - The emoji to use to remove the help message

example

pretty_help.AppMenu

  • Uses Application Interactions (buttons) for navigating
  • timeout - The duration the interaction will be active for. Defaults to None.
  • ephemeral - Send as an ephemeral message. Defaults to False.

example

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.

example

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

discord_pretty_help-2.0.5.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

discord_pretty_help-2.0.5-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file discord_pretty_help-2.0.5.tar.gz.

File metadata

  • Download URL: discord_pretty_help-2.0.5.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.5 Windows/10

File hashes

Hashes for discord_pretty_help-2.0.5.tar.gz
Algorithm Hash digest
SHA256 7f1262f3522cb6dda9e5227e9910c1f9dcef53bafad31003743d669fac507890
MD5 2b798637a3b47413be1119b39b04d275
BLAKE2b-256 a3da4da1e5ae738100457bc8648a439794167784662ad45f355a5cbb93875c75

See more details on using hashes here.

File details

Details for the file discord_pretty_help-2.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for discord_pretty_help-2.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9a4f65fd3d0d25d4acde377f59493d2e156db8d368d22609c7ebec16f07cd151
MD5 7e01abf2fb2394c189bd08c7cb8bec0b
BLAKE2b-256 570af5c3de5b81522ae097d8770a1f1e090ae6c70f49887610d22423a131c3a9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page