Skip to content

Commit d9a532e

Browse files
committed
docs fixes, message attribute fix
1 parent 3d04a71 commit d9a532e

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

discord/ext/menus/pagination.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ class Paginator(discord.ui.View):
7777
user: Optional[Union[:class:`~discord.User`, :class:`~discord.Member`]]
7878
The user or member that invoked the Paginator.
7979
message: Union[:class:`~discord.Message`, :class:`~discord.WebhookMessage`]
80-
The message sent from the Paginator.
80+
The message the Paginator is attached to.
8181
8282
Parameters
8383
----------
8484
pages: Union[List[:class:`str`], List[:class:`discord.Embed`]]
85-
Your list of strings or embeds to paginate
85+
Your list of strings and/or embeds to paginate
8686
show_disabled: :class:`bool`
8787
Choose whether or not to show disabled buttons
8888
show_indicator: :class:`bool`
@@ -114,7 +114,7 @@ def __init__(
114114
self.show_indicator = show_indicator
115115
self.disable_on_timeout = disable_on_timeout
116116
self.custom_view = custom_view
117-
self.message: Union[discord.Message, discord.WebhookMessage]
117+
self.message: Union[discord.Message, discord.WebhookMessage, None] = None
118118
self.buttons = {
119119
"first": {
120120
"object": PaginatorButton(
@@ -221,6 +221,7 @@ def customize_button(
221221
----------
222222
button_name: :class:`str`
223223
Name of the button to customize
224+
Must be one of ``first``, ``prev``, ``next``, or ``last``.
224225
button_label: :class:`str`
225226
Label to display on the button
226227
button_emoji:
@@ -248,7 +249,7 @@ def update_buttons(self) -> Dict:
248249
Returns
249250
-------
250251
Dict[:class:`str`, Dict[:class:`str`, Union[:class:`~PaginatorButton`, :class:`bool`]]]
251-
The dictionary of buttons that was updated.
252+
The dictionary of buttons that were updated.
252253
"""
253254
for key, button in self.buttons.items():
254255
if key == "first":

docs/ext/menus/index.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A Basic Example Of `ext.menus` Being Used
1818
from discord.ext import commands, menus
1919
2020
21-
class MenusExample(commands.Cog):
21+
class PageTest(commands.Cog):
2222
def __init__(self, bot):
2323
self.bot = bot
2424
@@ -34,8 +34,8 @@ A Basic Example Of `ext.menus` Being Used
3434
def get_pages(self):
3535
return self.pages
3636
37-
@slash_command(name="pageexample")
38-
async def pageexample(self, ctx):
37+
@slash_command(name="pagetest")
38+
async def pagetest(self, ctx):
3939
await ctx.defer()
4040
pages = menus.Paginator(pages=self.get_pages(), show_disabled=False, show_indicator=True)
4141
pages.customize_button("next", button_label=">", button_style=discord.ButtonStyle.green)
@@ -44,8 +44,8 @@ A Basic Example Of `ext.menus` Being Used
4444
pages.customize_button("last", button_label=">>", button_style=discord.ButtonStyle.blurple)
4545
await pages.send(ctx, ephemeral=False)
4646
47-
@slash_command(name="pageexample_custom")
48-
async def pageexample_custom(self, ctx):
47+
@slash_command(name="pagetest_custom")
48+
async def pagetest_custom(self, ctx):
4949
await ctx.defer()
5050
view = discord.ui.View()
5151
view.add_item(discord.ui.Button(label="Test Button, Does Nothing", row=1))
@@ -60,7 +60,7 @@ A Basic Example Of `ext.menus` Being Used
6060
6161
6262
def setup(bot):
63-
bot.add_cog(MenusExample(bot))
63+
bot.add_cog(PageTest(bot))
6464
6565
.. _discord_ext_menus_api:
6666

0 commit comments

Comments
 (0)