A library to create a discord.py 2.0+ paginator. Supports pagination with buttons, reactions, and category selection using selects.
Page.from_embeds()
ViewSelect
, the discord.SelectOption
parameter default
can no longer be set to True
(#55).ViewMenu
would result in an exception/indefinite "thinking" state if the user already responded to the interaction (#38)ctx
has been changed to method
for ReactionMenu
& ViewMenu
constructor and is now positional onlymenu_type
for ReactionMenu
& ViewMenu
constructor is now keyword onlyReactionMenu
has been removedPage
class has been added. Represents each "page" added via .add_page()
/.add_pages()
.last_viewed
now returns a Page
. .pages
now returns a List[Page]
ViewButton.skip()
& ReactionButton.skip()
has been renamed to .generate_skip()
because of an earlier name conflict.ReactionMenu
& ViewMenu
. With this update, each method by default now returns or stops menu's according to whichever class the method was invoked from. For example, ViewMenu.stop_all_sessions()
only stops all ViewMenu
sessions instead of all ReactionMenu
sessions as well as ViewMenu
sessions.
.get_all_dm_sessions()
.get_all_sessions()
.get_session(name: str)
.stop_all_sessions()
.stop_session(name: str, include_all=False)
.get_sessions_count()
.split_sessions()
& .stop_only()
have been removedViewMenu
, method .refresh_menu_buttons()
has been renamed to .refresh_menu_items()
remove_buttons
and disable_buttons
have been removed from method ViewMenu.stop()
. With the addition of selects, the following new parameters will now take their place
remove_items
disable_items
ViewMenu
class
disable_buttons_on_timeout
→ disable_items_on_timeout
remove_buttons_on_timeout
→ remove_items_on_timeout
.add_from_messages()
is no longer async
ViewButton
link buttons would be removed even after setting it as persistentreply
kwarg for ReactionMenu
in a thread or voice channel now works as intended.add_page()
has two new parameters
.add_page(embed)
.add_page(embed=MISSING, content=None, files=MISSING)
quick_start()
. Start a menu with it's default settings only adding the pagesmenu_type
. Displays the menu type that was set in the constructorrows
. Returns all the data that was added to the menu via .add_row()
.randomize_embed_colors()
. Selects a random color for all embeds added to the menuseparator
parameter
.set_page_director_style(..., separator=DEFAULT)
send_to
parameter in the .start()
method.persist
kwarg to ViewButton
. This prevents link buttons from being disabled/removed when the menu times out or is stopped so they can remain clickableViewSelect
. Used to choose categories in the menu. With the addition of selects, the following methods have been added
.add_select(select: ViewSelect)
.remove_select(select: ViewSelect)
.remove_all_selects()
.disable_select(select: ViewSelect)
.disable_all_selects()
.enable_select(select: ViewSelect)
.enable_all_selects()
.get_select(title: Union[str, None])
.set_select_option_relay(func: Callable[[NamedTuple], None], *, only: Optional[Sequence[str]]=None)
.remove_select_option_relay()
.selects
. Returns all ViewSelect
associated with the menuSelectNotFound
Page
class has been added to __init__
and is now available for usemethod
parameter in either the ReactionMenu
or ViewMenu
constructor is of the wrong type, IncorrectType
is now raisedquick_start()
. Start a menu with it's default settings only adding the pagesmenu_type
. Displays the menu type that was set in the constructorpersist
kwarg to ViewButton
. This prevents link buttons from being disabled/removed when the menu times out or is stopped so they can remain clickableThe default behavior for the below methods have changed. Previously, using the below methods would return/stop menu's for both ReactionMenu
& ViewMenu
. With this update, each method by default now returns or stops menu's according to whichever class the method was invoked from. For example, ViewMenu.stop_all_sessions()
only stops all ViewMenu
sessions instead of all ReactionMenu
sessions and ViewMenu
sessions. This is done with the addition of the fixed
parameter for the following methods. If you like the old behavior, simply set the fixed
parameter to False
.get_all_dm_sessions(fixed=True)
.get_all_sessions(fixed=True)
.get_session(name: str, fixed=True)
.stop_all_sessions(fixed=True)
.stop_session(name: str, include_all=False, fixed=True)
.get_sessions_count(fixed=True)
With this change, method .stop_only()
is now deprecated
ReactionMenu.STATIC
and ReactionMenu.DYNAMIC
have been renamed
ReactionMenu.STATIC
ReactionMenu.TypeEmbed
ReactionMenu.DYNAMIC
ReactionMenu.TypeEmbedDynamic
ReactionMenu
have been changed
ReactionMenu(ctx, back_button='⬅️', next_button='➡️', config=ReactionMenu.STATIC)
ReactionMenu(ctx, menu_type=ReactionMenu.TypeEmbed)
ReactionMenu
and TextMenu
are no longer separate classes. TextMenu
has been merged into ReactionMenu
. You can use a text menu by doing the following
ReactionMenu(..., menu_type=ReactionMenu.TypeText)
Button
class has been renamed to ReactionButton
to avoid compatibility issues with pycord 2.0ButtonType
has been moved and setting the linked_to
of a button is now set through the button itself
Button(..., linked_to=ButtonType.NEXT_PAGE)
ReactionButton(..., linked_to=ReactionButton.Type.NEXT_PAGE)
ButtonType.caller_details()
has been renamed and moved to ReactionButton
Button(..., details=ButtonType.caller_details())
ReactionButton(..., details=ReactionButton.set_caller_details())
ReactionMenu
parameters back_button
and next_button
have been removed. Use ReactionMenu.add_button()
insteadReactionMenu
parameter config
has been removed/replaced with parameter menu_type
ReactionMenu.run_time
ReactionMenu.default_next_button
ReactionMenu.default_back_button
ReactionMenu.all_buttons
. Use ReactionMenu.buttons
insteadReactionMenu.next_buttons
ReactionMenu.back_buttons
ReactionMenu.first_page_buttons
ReactionMenu.last_page_buttons
ReactionMenu.caller_buttons
ReactionMenu.end_session_buttons
ReactionMenu.go_to_page_buttons
ReactionMenu.help_appear_order()
ReactionMenu.change_appear_order()
SingleUseOnly
ReactionMenu.clear_all_buttons()
to ReactionMenu.remove_all_buttons()
ReactionMenu.all_can_react
is now ReactionMenu.all_can_click
turn_every
in methods ReactionMenu.set_as_auto_paginator()
and ReactionMenu.update_turn_every()
are now keyword only argumentsReactionMenu
attributes are no longer property getters/setters. They are now normal attributes with type hints.get_menu_from_message()
is now positional onlylist
instead of list
or None
(if no sessions/buttons were found). If no sessions/buttons were found, an empty list is returned
.get_all_dm_sessions()
.get_all_sessions()
.get_session()
.buttons_most_clicked
.buttons
Discords Buttons feature has been implemented using pycord. Two classes have been renamed/removed to support discord.ui.View
ButtonsMenu
class
ViewMenu
ViewMenu.update()
method arguments are now keyword onlyComponentsButton
class
ViewButton
ComponentsButton
factory methods. They've been renamed and are now apart of the ViewButton
class
ComponentsButton.basic_back()
ComponentsButton.basic_next()
ViewButton.back()
ViewButton.next()
ReactionMenu.EMOJI_BACK_BUTTON
ReactionMenu.EMOJI_NEXT_BUTTON
ReactionMenu.Emojis.BACK_BUTTON
ReactionMenu.Emojis.NEXT_BUTTON
ReactionButton
names are now case sensitive if you were to get
a buttonReactionMenu
has been replaced by a new method
ReactionMenu.get_button_by_name(name: str)
ReactionMenu.get_button(identity: Union[str, int], *, search_by='name')
. This method now returns only a list
of buttons instead of either a single button or multiple buttonsID_CALLER
information is different now. See the documentation for proper implementationReactionButton(..., skip=ReactionButton.Skip(...))
ReactionMenu.set_relay(..., only: List[ReactionButton]=None)
ReactionMenu.remove_on_timeout()
ReactionMenu.add_pages(pages: Sequence[Union[discord.Embed, str]])
ReactionMenu.add_buttons(buttons: Sequence[ReactionButton])
reply
to the start
method. Enables the menu message to reply to the message that triggered it
ReactionMenu.start(..., reply: bool=False)
ReactionMenu.last_viewed
. Returns the last page that was seen by the user in the pagination processReactionMenu.add_from_ids(messageable: discord.abc.Messageable, message_ids: Sequence[int])
ReactionMenu.add_from_messages(messages: Sequence[discord.Message])
Reactionmenu.separate(values: Sequence[Any])
discord.Embed
or str
ReactionMenu.all_embeds(values: Sequence[Any])
ReactionMenu.all_strings(values: Sequence[Any])
ReactionMenu
's and ViewMenu
's into two separate lists
ReactionMenu.split_sessions()
ReactionMenu
's or ViewMenu
's
ReactionMenu.stop_only(session_type: str)
ReactionMenu.set_page_director_style(style_id: int)
ReactionButton
ReactionButton.back()
ReactionButton.next()
ReactionButton.go_to_first_page()
ReactionButton.go_to_last_page()
ReactionButton.go_to_page()
ReactionButton.end_session()
ReactionButton.all()
ReactionButton.skip(emoji: str, action: str, amount: int)
ReactionMenu.remove_extra_emojis
ViewButton
ViewButton.link(label: str, url: str)
ViewButton.skip(label: str, action: str, amount: int)
ViewMenu.randomize_button_styles()
ViewMenu.set_button_styles(style: discord.ButtonStyle)
ViewButton
now has a name
attributeViewMenu.get_button()
to get buttons by name
ViewMenu.get_button(..., search_by='name')
ReactionButton
& ViewButton
attribute last_clicked
now supports an aware datetime.datetime
send_to
parameter in method .start()
now supports threads.set_on_timeout()
now raises IncorrectType
instead of MenuException
if the parameter given was not callableReactionMenu.add_button()
now also raises MenuSettingsMismatch
ReactionMenu.refresh_auto_pagination_data()
now raises an error if no data was given in it's parameterViewMenuException
and MenuException
. All library exceptions can be caught using MenuException
reactionmenu.version_info()
. Used if submitting a GitHub issue__all__
for reactionmenu
(from reactionmenu import *
)__repr__
for ViewButton.Followup