Skip to content

Customization

Let's see how to customize messages from the help system.

 

1. The title of the page. You can change it by specifying the title keyword argument through the Page constructor.

page_help = Page('message', title="Welcome to the help !")

 

2. The main message of the page. You can change it through the Page constructor.

page_help = Page('Help pages are simply a tree of pages and the system navigate through this tree.')

 

3. The description of each link. You can change it when creating a link to a page with the link method.

page_help.link(page_react, description='What about reaction ?')

 

4. The emoji of reaction for a given link. You can change it when creating a link to a page with the link method. By default, the emoji used is the digit emoji.

page_help.link(page_react, description='What about reaction ?')                     # Use default emoji
page_help.link(page_react, reaction='👌', description='What about reaction ?')      # Use customized emoji

 

5. The emoji for the parent page. You can change it either when creating a link to a page with the link method, or by setting a parent page separately with the parent_of method.

page_help.link(page_react, description='What about reaction ?', parent_reaction='👌')        # Specified when
# parent reaction is automatically created when making a link

page_guild.parent_of(page_guild_register, parent_reaction='👌')              # Specified when creating a new parent link

 

6. The emoji for the root page. You can change it when setting a root page with the root_of method.

root.root_of([page_react, page_everyone, page_slow, page_help, page_cmd], root_reaction='👌')

 

7. The emoji for quitting. You can change it with the Help constructor.

h = Help(client, root, quit_react='👌')

 

8. The color of the Embed. You can change it by specifying the color keyword argument through the Page constructor.

page_help = Page('message', color=0xE67E22)

Prior to v4 of the package, Help was rendered as simple text message. From v4 of the package, the Help is now rendered as Embed by default, because the interface looks cleaner.

If you still want to display your page as a simple text message, you can specify it by setting the argument embed to False in the Page constructor.

page_help = Page('message', embed=False)

Warning

Simple text message pages can't use Embed features, such as title and color.

Tip

If you need to customize your display further, you can always subclass Page and redefine get_message() or get_embed().