Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add user argument to paginator.edit #2390

Merged
merged 7 commits into from
Mar 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
patch paginator.edit
  • Loading branch information
NeloBlivion authored and Lulalaby committed Mar 9, 2024
commit c687347ae230660c4478c7907a45889226da156e
7 changes: 6 additions & 1 deletion discord/ext/pages/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import discord
from discord.ext.bridge import BridgeContext
from discord.ext.commands import Context
from discord.user import User
from discord.member import Member

__all__ = (
"PaginatorButton",
Expand Down Expand Up @@ -1035,6 +1037,7 @@ async def edit(
suppress: bool | None = None,
allowed_mentions: discord.AllowedMentions | None = None,
delete_after: float | None = None,
user: User | Member | None = None,
) -> discord.Message | None:
"""Edits an existing message to replace it with the paginator contents.

Expand All @@ -1060,6 +1063,8 @@ async def edit(
are used instead.
delete_after: Optional[:class:`float`]
If set, deletes the paginator after the specified time.
user: Optional[Union[:class:`~discord.User`, :class:`~discord.Member`]]
If set, changes the user that this paginator belongs to.

Returns
-------
Expand All @@ -1079,7 +1084,7 @@ async def edit(
if page_content.custom_view:
self.update_custom_view(page_content.custom_view)

self.user = message.author
self.user = user or self.user

try:
self.message = await message.edit(
Expand Down