Skip to content

Commit 43a9ee7

Browse files
NeloBlivionpre-commit-ci[bot]plun1331
authored
fix: add user argument to paginator.edit (Pycord-Development#2390)
* patch paginator.edit * style(pre-commit): auto fixes from pre-commit.com hooks * changelog * style(pre-commit): auto fixes from pre-commit.com hooks * Update CHANGELOG.md --------- Signed-off-by: plun1331 <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: plun1331 <[email protected]>
1 parent ca07054 commit 43a9ee7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ These changes are available on the `master` branch, but have not yet been releas
1414

1515
- Added `banner` parameter to `ClientUser.edit`.
1616
([#2396](https://github.com/Pycord-Development/pycord/pull/2396))
17+
- Added `user` argument to `Paginator.edit`.
18+
([#2390](https://github.com/Pycord-Development/pycord/pull/2390))
1719

1820
### Fixed
1921

@@ -22,6 +24,8 @@ These changes are available on the `master` branch, but have not yet been releas
2224
- Fixed a deprecation warning from being displayed when running `python -m discord -v`
2325
by replacing the deprecated module.
2426
([#2392](https://github.com/Pycord-Development/pycord/pull/2392))
27+
- Fixed `Paginator.edit` to no longer set user to the bot.
28+
([#2390](https://github.com/Pycord-Development/pycord/pull/2390))
2529

2630
### Changed
2731

discord/ext/pages/pagination.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import discord
3030
from discord.ext.bridge import BridgeContext
3131
from discord.ext.commands import Context
32+
from discord.member import Member
33+
from discord.user import User
3234

3335
__all__ = (
3436
"PaginatorButton",
@@ -1035,6 +1037,7 @@ async def edit(
10351037
suppress: bool | None = None,
10361038
allowed_mentions: discord.AllowedMentions | None = None,
10371039
delete_after: float | None = None,
1040+
user: User | Member | None = None,
10381041
) -> discord.Message | None:
10391042
"""Edits an existing message to replace it with the paginator contents.
10401043
@@ -1060,6 +1063,8 @@ async def edit(
10601063
are used instead.
10611064
delete_after: Optional[:class:`float`]
10621065
If set, deletes the paginator after the specified time.
1066+
user: Optional[Union[:class:`~discord.User`, :class:`~discord.Member`]]
1067+
If set, changes the user that this paginator belongs to.
10631068
10641069
Returns
10651070
-------
@@ -1079,7 +1084,7 @@ async def edit(
10791084
if page_content.custom_view:
10801085
self.update_custom_view(page_content.custom_view)
10811086

1082-
self.user = message.author
1087+
self.user = user or self.user
10831088

10841089
try:
10851090
self.message = await message.edit(

0 commit comments

Comments
 (0)