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

Add ext.menus pagination module #539

Merged
merged 57 commits into from
Dec 19, 2021
Merged
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
1c9c4fe
add back ext.menus
krittick Nov 17, 2021
9f33089
Merge branch 'Pycord-Development:master' into ext-menus
krittick Nov 17, 2021
e93ddf1
Merge branch 'master' into ext-menus
krittick Nov 24, 2021
62edad8
Merge branch 'master' into ext-menus
krittick Dec 3, 2021
450d2a6
almost a complete rework - needs more tweaking
krittick Dec 4, 2021
46217e7
minor formatting changes
krittick Dec 4, 2021
e851d6a
only show first/last buttons when not on a page directly adjacent to …
krittick Dec 4, 2021
8155142
add ability to append items from a custom view to the pagination view
krittick Dec 4, 2021
345a2b5
more formatting changes, change unnecessary usage of MISSING to None
krittick Dec 4, 2021
0b079f7
add optional page indicator
krittick Dec 4, 2021
8f590b7
fix weird refactor recommendation, thanks sourcery
krittick Dec 4, 2021
8c7d325
initial attempt to add a customize_button method
krittick Dec 4, 2021
22a297f
fix bug when custom views aren't specified
krittick Dec 4, 2021
4b139b3
make page indicator counts use a more human-friendly format (i.e. +1)
krittick Dec 4, 2021
e62f33c
change main class name, add some comments, etc
krittick Dec 5, 2021
9972b08
add goto_page method
krittick Dec 5, 2021
fea9dcb
more comments
krittick Dec 5, 2021
e54b039
add support for sending paginated messages from interactions
krittick Dec 5, 2021
97dab81
whoops
krittick Dec 5, 2021
f2c0183
add basic example
krittick Dec 6, 2021
64a1ea8
add additional example for custom view support
krittick Dec 6, 2021
b474686
consistent quote usage
krittick Dec 6, 2021
4deb7a1
Revert "consistent quote usage"
krittick Dec 6, 2021
f75dfda
Documenting ext.menus
VincentRPS Dec 7, 2021
e559486
Merge pull request #1 from RPSMain/ext-menus
krittick Dec 7, 2021
df5cde2
Fixing Menus Docs
VincentRPS Dec 7, 2021
4a9c149
Fix
VincentRPS Dec 7, 2021
5709ca6
Merge pull request #2 from RPSMain/ext-menus
krittick Dec 7, 2021
a973410
Merge branch 'master' into ext-menus
krittick Dec 7, 2021
0e6fc9a
Merge branch 'Pycord-Development:master' into ext-menus
krittick Dec 7, 2021
195ba20
docs updates
krittick Dec 7, 2021
9e014b4
more docstring updates
krittick Dec 7, 2021
9813fe0
more docstring updates
krittick Dec 7, 2021
12adb79
make return types for send/respond more consistent
krittick Dec 7, 2021
973e49e
Apply suggestions from code review
Lulalaby Dec 7, 2021
818be51
more docstrings, add attributes block for Paginator class
krittick Dec 7, 2021
61844cc
Merge remote-tracking branch 'origin/ext-menus' into ext-menus
krittick Dec 7, 2021
2e00f84
more docstrings
krittick Dec 7, 2021
b84d358
fix note
krittick Dec 7, 2021
a4228dd
Merge branch 'master' into ext-menus
krittick Dec 10, 2021
e8d17a8
start work on adding timeout handling to paginator
krittick Dec 12, 2021
5038080
Merge branch 'Pycord-Development:master' into ext-menus
krittick Dec 13, 2021
ffb1027
Merge remote-tracking branch 'origin/ext-menus' into ext-menus
krittick Dec 14, 2021
67f0a7f
timeout work
krittick Dec 14, 2021
3a0101f
update return values, add message attribute
krittick Dec 14, 2021
546a51e
update return values, add message attribute
krittick Dec 14, 2021
0106c48
update return values, add message attribute
krittick Dec 14, 2021
ecf7850
add disable_on_timeout parameter
krittick Dec 14, 2021
b88d833
add changes to message returns in respond() as well
krittick Dec 14, 2021
35a0bab
revert inadvertent change to setup.py
krittick Dec 14, 2021
0ccbeee
[wip] partial fix for slash groups example (#574)
krittick Dec 16, 2021
1f60568
potential fix for second part of slash groups example
krittick Dec 16, 2021
824a5c6
Revert "potential fix for second part of slash groups example"
krittick Dec 16, 2021
039ccd7
Merge branch 'Pycord-Development:master' into ext-menus
krittick Dec 17, 2021
14ec7c0
Merge branch 'Pycord-Development:master' into master
krittick Dec 18, 2021
08cf279
Merge remote-tracking branch 'origin/master' into ext-menus
krittick Dec 19, 2021
36204e2
fix typing
krittick Dec 19, 2021
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
Prev Previous commit
Next Next commit
update return values, add message attribute
  • Loading branch information
krittick committed Dec 14, 2021
commit 546a51e3ae62ddc1aad274ae1647af0463693399
8 changes: 5 additions & 3 deletions discord/ext/menus/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,11 @@ def __init__(

async def on_timeout(self) -> None:
"""Disables all buttons when the view times out."""
for key, btn in self.buttons.items():
btn["hidden"] = True
btn["object"].disabled = True
# for key, btn in self.buttons.items():
# btn["hidden"] = True
# btn["object"].disabled = True
for item in self.children:
item.disabled = True
await self.message.edit(view=self)

async def goto_page(self, interaction: discord.Interaction, page_number=0):
Expand Down