A library to create a discord.py 2.0+ paginator. Supports pagination with buttons, reactions, and category selection using selects.
BM
= ButtonsMenu
RM
= ReactionMenu
TM
= TextMenu
DescriptionOversized
, typically raised when using a dynamic menu and the amount of rows_requested
is too large for the amount of information received, has been updated to reflect that changeBM
Added ComponentsButton.ID_CUSTOM_EMBED
for ComponentsButton
. Buttons that go to the specified embed when clicked and are not apart of the normal pagination processBM
Added the ability to get the ButtonsMenu
instance from a ComponentsButton
ComponentsButton.menu
BM
Added the ability to call a function when buttons are pressed
ButtonsMenu.set_relay()
ButtonsMenu.remove_relay()
RM|TM
Added the ability to remove relays that have been set
ReactionMenu.remove_relay()
BM
Fixed an issue where a button with ComponentsButton.ID_CALLER
could not call discord.py command functionsBM
Fixes for method ButtonsMenu.update()
ComponentsButton.ID_CALLER
or ComponentsButton.ID_SEND_MESSAGE
was already registered to the menu and an attempt to reuse that button during a ButtonsMenu.update()
call, an error would occurnew_pages
, the page index value would still be from before the update, and clicking a back/next button would go to the wrong pagenew_pages
(embeds) that contained footers, the footer information would be removedBM
= ButtonsMenu
RM
= ReactionMenu
TM
= TextMenu
ButtonsMenu
). Discords new Buttons featureRM|TM
Added the ability to call a function upon menu timeout
ReactionMenu.set_on_timeout(func: object)
RM|TM
Added the ability to get the menu object from a message ID
ReactionMenu.get_menu_from_message(message_id: int)
RM|TM
Added the ability to set menu session limits per guild, channel, or member (before you could only set per guild)RM|TM
Added the ability to remove limits that have been set
ReactionMenu.remove_limit()
RM|TM
Added the ability to access the discord.Member
object of the person that started the menu
ReactionMenu.owner
RM|TM
Added owner
to __repr__
RM|TM
Added the ability to get all active DM sessions
ReactionMenu.get_all_dm_sessions()
TextMenu
). Just like the normal reaction menu but no embeds are involved, only plain text is used. TextMenu
has limited options compared to ReactionMenu
(docs)ReactionMenu
constructors back_button
and next_button
parameters can now be set to None
if you intend to set the menu as an auto-pagination menu (docs)
ReactionMenu.set_as_auto_paginator(turn_every: Union[int, float])
ReactionMenu.update_turn_every(turn_every: Union[int, float])
ReactionMenu.update_all_turn_every(turn_every: Union[int, float])
ReactionMenu.refresh_auto_pagination_data(*embeds: Embed)
ReactionMenu.stop_all_auto_sessions()
ReactionMenu.auto_turn_every
ReactionMenu.auto_paginator
back_button
/next_button
parameters in ReactionMenu
/TextMenu
as well as the emoji
parameter in Button
(docs)
ReactionMenu.EMOJI_NEXT_BUTTON
ReactionMenu.EMOJI_BACK_BUTTON
ReactionMenu.EMOJI_FIRST_PAGE
ReactionMenu.EMOJI_LAST_PAGE
ReactionMenu.EMOJI_GO_TO_PAGE
ReactionMenu.EMOJI_END_SESSION
ReactionMenu.clear_reactions_after
(set to False
)ReactionMenu.navigation_speed
(set to ReactionMenu.FAST
)ReactionMenu.delete_interactions
(set to False
)ReactionMenu.only_roles
(set to None
)ReactionMenu.timeout
(set to 60.0
if set to None
)ReactionMenu.auto_paginator
(set to False
)ReactionMenu.run_time
ReactionMenu.only_roles
discord.Message
object the menu is operating from (docs)
ReactionMenu.message
ReactionMenu.stop_all_sessions()
ReactionMenu.stop_session(name: str, include_all=False)
ReactionMenu.get_session(name: str)
ReactionMenu.get_all_sessions()
ReactionMenu.set_relay(func)
__repr__
for ReactionMenu
IncorrectType
, mainly raised when using a property setter and the supplied value type was not what was expected. NoButtons
, raised when the menu was started but there were no buttons registeredFixed an issue where it was possible to call ReactionMenu.set_main_pages()
and ReactionMenu.set_last_pages()
without actually implementing the necessary parameters
Fixed an issue where if ReactionMenu.clear_all_buttons()
was called and an attempt to access properties ReactionMenu.default_back_button
or ReactionMenu.default_next_button
, an error would occur. In addition, if other buttons were added to the menu after ReactionMenu.clear_all_buttons()
was called and the default back/next properties were accessed, it would not return the true default back/next buttons. It would return the most recently added button after ReactionMenu.clear_all_buttons()
was called. Accessing ReactionMenu.default_back_button
or ReactionMenu.default_next_button
now returns the true default back/next buttons (the buttons set in the ReactionMenu
constructor), even if all buttons were cleared
Fixed an issue where if a menu was sent to a channel other than the one it was triggered in using the send_to
kwarg in method ReactionMenu.start()
. Using a Button
with ButtonType.GO_TO_PAGE
, the prompt would ask what page you'd like to go to but wouldn't respond when a message was sent in the channel where the prompt was
Fixed an issue where if the menu was started with no buttons registered, an error would occur that was not informative. If there's an attempt to start the menu when no buttons are registered, an informative error (exception NoButtons
) is now raised
Fixed an issue where if buttons were added after all buttons were removed and those buttons did not have their name
kwarg set, an error would occur. The menu will now run as expected if buttons were added after all buttons were removed from the menu regardless of if a buttons optional kwarg was not set
ReactionMenu.cancel_all_sessions()
.cancel_all_sessions()
was used as an easy way to essentially "pull the plug" on all menu session processing. Although it being effective, it left certain values of the menu unchanged/not removed which was okay in versions <= 1.0.8
. With this update, because of the changes made for how the overall menu functions, those values are now way too important to be left unchanged/not removed. Using the new class method ReactionMenu.stop_all_sessions()
provides a much cleaner way to end all processing for active menusv1.0.9
, the below properties now return None
instead of an empty list if their list contains no itemsReactionMenu.all_buttons
ReactionMenu.next_buttons
ReactionMenu.back_buttons
ReactionMenu.delete_on_timeout
None
and the navigation_speed
was set to ReactionMenu.FAST
, an error would occurReactionMenu.NORMAL
ReactionMenu.FAST
ReactionMenu.NORMAL
or ReactionMenu.FAST
ReactionMenu.stop()
could stop the wrong instance