Skip to content

Conversation

fiskenslakt
Copy link
Contributor

Summary

If a paginator has a timeout of 15min or more and is set to be ephemeral, the intended exception notifying the user they can't do that fails to get raised because it attempts to compare None with int.

Example traceback:

Traceback (most recent call last):
  File "/Users/derek/Code/pzsd-bot/.venv/lib/python3.12/site-packages/discord/commands/core.py", line 138, in wrapped
    ret = await coro(arg)
          ^^^^^^^^^^^^^^^
  File "/Users/derek/Code/pzsd-bot/.venv/lib/python3.12/site-packages/discord/commands/core.py", line 1078, in _invoke
    await self.callback(self.cog, ctx, **kwargs)
  File "/Users/derek/Code/pzsd-bot/pzsd_bot/cogs/points/admin.py", line 178, in users
    await paginator.respond(ctx.interaction, ephemeral=True)
  File "/Users/derek/Code/pzsd-bot/.venv/lib/python3.12/site-packages/discord/ext/pages/pagination.py", line 1155, in respond
    if ephemeral and (self.timeout >= 900 or self.timeout is None):
                      ^^^^^^^^^^^^^^^^^^^
TypeError: '>=' not supported between instances of 'NoneType' and 'int'

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.

Copy link
Member

@Paillat-dev Paillat-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good pr, lgtm for all it's worth.

@Lulalaby Lulalaby enabled auto-merge (squash) February 24, 2025 10:20
@Lulalaby Lulalaby merged commit a145bcd into Pycord-Development:master Feb 24, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants