-
-
Notifications
You must be signed in to change notification settings - Fork 471
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
Various Paginator fixes for disable()
, cancel()
, and respond
methods.
#1088
Conversation
…age to Message
@Ahsoka I've tested these myself, but would you mind testing these fixes to ensure they work for you as well? |
Sure I'll test this as soon as I get I chance. I'm working on physics homework at the moment. |
@krittick The fix for the This comes down to this condition here: if self.custom_view and (item not in self.custom_view.children or include_custom): In English the first part of this condition says unless there is a custom view don't disable any of the children of this paginator. A proper fix would be: for item in self.children:
if include_custom or not self.custom_view: # Might want to explictly check for None instead of using not bool(self.custom_view)
# We can do that like this: if include_custom or self.custom_view is None:
item.disabled = True
elif item not in self.custom_view.children:
item.disabled = True |
I will try to do somewhat rigorous testing of your fix of the expiring web token. Will get to back to you soon. |
That's what I get for writing code while recovering from surgery, haha. Will fix. |
Pull request was converted to draft
Logic should be fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the testing I've conducted it appears that this works. I was able to use the paginator after 15 minutes and even after 24 hours as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine but I would be weary about using not self.custom_view
, if someone ever implements a custom __bool__
method this might be an issue. It's probably best to use self.custom_view is None
since there is no reason to not use it (at least from what I can tell).
Summary
This adds an additional logic check to see if the
Paginator.custom_view
is not None when trying to disable or cancel items in a paginator that has no custom view.Fixes #1082
This also adds a conversion from
WebhookMessage
andInteractionMessage
inPaginator.respond()
to assign the actualMessage
object toPaginator.message
instead of the former. This avoids the interaction token expiring and preventing interacting with the message after 15 minutes.Fixes #1083
Checklist
type: ignore
comments were used, a comment is also left explaining why