Skip to content

Commit 25b5b3c

Browse files
authored
Update ext.menus docs
1 parent d9a532e commit 25b5b3c

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

docs/ext/menus/index.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55

66
.. versionadded:: 2.0
77

8-
Menus provide a easy pagination system with buttons
8+
This module provides an easy pagination system with buttons.
99

10-
Example:
11-
--------
12-
A Basic Example Of `ext.menus` Being Used
10+
Example usage in a cog:
1311

1412
.. code-block:: python3
1513
@@ -23,9 +21,9 @@ A Basic Example Of `ext.menus` Being Used
2321
self.bot = bot
2422
2523
self.pages = [
26-
"Page One",
27-
discord.Embed(title="Page Two"),
28-
discord.Embed(title="Page Three"),
24+
"Page One", # string (text)
25+
discord.Embed(title="Page Two"), # rich embed
26+
discord.Embed(title="Page Three"), # another rich embed
2927
]
3028
self.pages[1].set_image(url="https://c.tenor.com/pPKOYQpTO8AAAAAM/monkey-developer.gif")
3129
self.pages[2].add_field(name="Example Field", value="Example Value", inline=False)
@@ -37,13 +35,19 @@ A Basic Example Of `ext.menus` Being Used
3735
@slash_command(name="pagetest")
3836
async def pagetest(self, ctx):
3937
await ctx.defer()
38+
# initializing the paginator
4039
pages = menus.Paginator(pages=self.get_pages(), show_disabled=False, show_indicator=True)
40+
41+
# customising buttons
4142
pages.customize_button("next", button_label=">", button_style=discord.ButtonStyle.green)
4243
pages.customize_button("prev", button_label="<", button_style=discord.ButtonStyle.green)
4344
pages.customize_button("first", button_label="<<", button_style=discord.ButtonStyle.blurple)
4445
pages.customize_button("last", button_label=">>", button_style=discord.ButtonStyle.blurple)
46+
47+
# start paginating
4548
await pages.send(ctx, ephemeral=False)
4649
50+
# using a custom view
4751
@slash_command(name="pagetest_custom")
4852
async def pagetest_custom(self, ctx):
4953
await ctx.defer()
@@ -73,4 +77,4 @@ API Reference
7377
:members:
7478

7579
.. autoclass:: discord.ext.menus.PaginatorButton
76-
:members:
80+
:members:

0 commit comments

Comments
 (0)