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

feat(ext.pages): add more ways to send paginator by editing #2105

Closed
wants to merge 32 commits into from

Conversation

OmLanke
Copy link
Contributor

@OmLanke OmLanke commented Jun 8, 2023

Summary

Allows the Paginator to be sent using the edit methods offered by Interaction, ApplicationContext, and BridgeContext.

Also fixes #1877 by adding a new parameter user, when passing a Message object.

paginator.edit() didn't work at all, because paginator.user was being set to message.author. But message.author will always be the bot itself, since it can edit that message. This caused the views to not respond, unless author_check was disabled. This means a user would need be to be explicitly accepted while calling paginator.edit(), thus the new parameter.

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

@OmLanke OmLanke changed the title feat(ext.pages): add more ways to send via edit feat(ext.pages): add more ways to send paginator via edit Jun 8, 2023
@OmLanke OmLanke changed the title feat(ext.pages): add more ways to send paginator via edit feat(ext.pages): add more ways to send paginator by editing Jun 8, 2023
@Lulalaby Lulalaby changed the title feat(ext.pages): add more ways to send paginator by editing feat!(ext.pages): add more ways to send paginator by editing Jun 8, 2023
@Lulalaby Lulalaby changed the title feat!(ext.pages): add more ways to send paginator by editing feat!: ext.pages: add more ways to send paginator by editing Jun 8, 2023
@OmLanke
Copy link
Contributor Author

OmLanke commented Jun 11, 2023

On hold. There is parameter discrepancy between methods.

Interaction.edit_original_response doesn't accept suppress kwarg, since discord doesn't support it for webhook message edits.

InteractionResponse.edit_message doesn't seem to accept suppress and allowed_mention kwargs, even though it looks like discord accepts it in the flags (link)?

@OmLanke
Copy link
Contributor Author

OmLanke commented Jun 23, 2023

Should be good after #2138 is merged

@OmLanke OmLanke marked this pull request as ready for review June 25, 2023 14:47
@OmLanke OmLanke requested a review from a team as a code owner June 25, 2023 14:47
@pullapprove4 pullapprove4 bot requested a review from FrostByte266 June 25, 2023 14:47
@pullapprove4 pullapprove4 bot requested a review from plun1331 June 25, 2023 14:47
OmLanke and others added 3 commits June 25, 2023 20:47
Signed-off-by: Om <92863779+Om1609@users.noreply.github.com>
Signed-off-by: Om <92863779+Om1609@users.noreply.github.com>
@Lulalaby Lulalaby enabled auto-merge (squash) June 25, 2023 16:25
Lulalaby
Lulalaby previously approved these changes Jun 25, 2023
@JustaSqu1d JustaSqu1d self-requested a review July 11, 2023 18:37
discord/ext/pages/pagination.py Outdated Show resolved Hide resolved
Signed-off-by: Om <92863779+Om1609@users.noreply.github.com>
@OmLanke OmLanke changed the title feat(ext.pages)!: add more ways to send paginator by editing feat(ext.pages): add more ways to send paginator by editing Jul 14, 2023
Signed-off-by: Om <92863779+Om1609@users.noreply.github.com>
discord/ext/pages/pagination.py Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Paginator View doesn't respond if paginator buttons were added via editing the message
4 participants