- Fixed an issue where
ViewSelect.GoToallowed all users to control the menu (#57)
Click to display changelog
- Added method
Page.from_embeds()
- In a
ViewSelect, thediscord.SelectOptionparameterdefaultcan no longer be set toTrue(#55).
Click to display changelog
- Fixed an issue where the slash command in hybrid commands would result in a "The application did not respond" error (#47).
Click to display changelog
- Fixed a dependency issue where typing-extensions would cause installation problems
Click to display changelog
- Fixed an issue where an error would occur when
pipinstalling the library
Click to display changelog
- Fixed an issue where a
ViewMenuwould result in an exception/indefinite "thinking" state if the user already responded to the interaction (#38)
- Added support for GitHub commit hash versioning. This will help determine exactly what commit version of the library the user is using.
Click to display changelog
- This library is no longer dependent on Pycord. It has changed back to discord.py
- Parameter
ctxhas been changed tomethodforReactionMenu&ViewMenuconstructor and is now positional only - Parameter
menu_typeforReactionMenu&ViewMenuconstructor is now keyword only - The auto-paginate feature for
ReactionMenuhas been removed - The
Pageclass has been added. Represents each "page" added via.add_page()/.add_pages() - Using
.last_viewednow returns aPage..pagesnow returns aList[Page] - Class methods
ViewButton.skip()&ReactionButton.skip()has been renamed to.generate_skip()because of an earlier name conflict. - The 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 allViewMenusessions instead of allReactionMenusessions as well asViewMenusessions..get_all_dm_sessions().get_all_sessions().get_session(name: str).stop_all_sessions().stop_session(name: str, include_all=False).get_sessions_count()- With this change, methods
.split_sessions()&.stop_only()have been removed
- With the addition of selects in
ViewMenu, method.refresh_menu_buttons()has been renamed to.refresh_menu_items() - Parameters
remove_buttonsanddisable_buttonshave been removed from methodViewMenu.stop(). With the addition of selects, the following new parameters will now take their placeremove_itemsdisable_items
- The following attributes have been renamed in the
ViewMenuclassdisable_buttons_on_timeout→disable_items_on_timeoutremove_buttons_on_timeout→remove_items_on_timeout
- Method
.add_from_messages()is no longerasync
- Fixed an issue where
ViewButtonlink buttons would be removed even after setting it as persistent - Using the
replykwarg forReactionMenuin a thread or voice channel now works as intended
- Pagination is no longer limited to just embeds or text. The normal embed menu can now paginate with embeds, text, as well as files. With this, method
.add_page()has two new parameters- Old:
.add_page(embed) - New:
.add_page(embed=MISSING, content=None, files=MISSING)
- Old:
- Added class method
quick_start(). Start a menu with it's default settings only adding the pages - Added property
menu_type. Displays the menu type that was set in the constructor - Added property
rows. Returns all the data that was added to the menu via.add_row() - Added method
.randomize_embed_colors(). Selects a random color for all embeds added to the menu - Added method
.version_info(). A simple shortcut to functionreactionmenu.version_info() - Added the ability to set the separator between the page director and embed footer text via the
separatorparameter.set_page_director_style(..., separator=DEFAULT)
- Added support for voice channels to be utilized via the
send_toparameter in the.start()method.
- Added the ability to use a select to go to a page instead of using text input
- Added the
persistkwarg toViewButton. This prevents link buttons from being disabled/removed when the menu times out or is stopped so they can remain clickable - Added class
ViewSelect. 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()
- Added property
.selects. Returns allViewSelectassociated with the menu
- Added exception
SelectNotFound - The
Pageclass has been added to__init__and is now available for use - If the
methodparameter in either theReactionMenuorViewMenuconstructor is of the wrong type,IncorrectTypeis now raised
Click to display changelog
- Added class method
quick_start(). Start a menu with it's default settings only adding the pages - Added property
menu_type. Displays the menu type that was set in the constructor
- Added the
persistkwarg toViewButton. This prevents link buttons from being disabled/removed when the menu times out or is stopped so they can remain clickable
-
The 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 allViewMenusessions instead of allReactionMenusessions andViewMenusessions. This is done with the addition of thefixedparameter for the following methods. If you like the old behavior, simply set thefixedparameter toFalse.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
Click to display changelog
- Fixed an issue where exceptions were being suppressed if one was to occur during the pagination process (
ReactionMenuonly)
- Added method
wait_until_close()
Click to display changelog
- With the discontinuation of discord.py, this library is now dependent on pycord
- changed
ReactionMenu.STATICandReactionMenu.DYNAMIChave been renamed- Old:
ReactionMenu.STATIC - New:
ReactionMenu.TypeEmbed - Old:
ReactionMenu.DYNAMIC - New:
ReactionMenu.TypeEmbedDynamic
- Old:
- changed/removed The parameters of
ReactionMenuhave been changed- Old:
ReactionMenu(ctx, back_button='⬅️', next_button='➡️', config=ReactionMenu.STATIC) - New:
ReactionMenu(ctx, menu_type=ReactionMenu.TypeEmbed)
- Old:
- changed/removed
ReactionMenuandTextMenuare no longer separate classes.TextMenuhas been merged intoReactionMenu. You can use a text menu by doing the followingReactionMenu(..., menu_type=ReactionMenu.TypeText)
- changed The
Buttonclass has been renamed toReactionButtonto avoid compatibility issues with pycord 2.0 - changed
ButtonTypehas been moved and setting thelinked_toof a button is now set through the button itself- Old:
Button(..., linked_to=ButtonType.NEXT_PAGE) - New:
ReactionButton(..., linked_to=ReactionButton.Type.NEXT_PAGE)
- Old:
- changed Method
ButtonType.caller_details()has been renamed and moved toReactionButton- Old:
Button(..., details=ButtonType.caller_details()) - New:
ReactionButton(..., details=ReactionButton.set_caller_details())
- Old:
- removed
ReactionMenuparametersback_buttonandnext_buttonhave been removed. UseReactionMenu.add_button()instead - removed
ReactionMenuparameterconfighas been removed/replaced with parametermenu_type - removed Attribute
ReactionMenu.run_time - removed Attribute
ReactionMenu.default_next_button - removed Attribute
ReactionMenu.default_back_button - removed Attribute
ReactionMenu.all_buttons. UseReactionMenu.buttonsinstead - removed Attribute
ReactionMenu.next_buttons - removed Attribute
ReactionMenu.back_buttons - removed Attribute
ReactionMenu.first_page_buttons - removed Attribute
ReactionMenu.last_page_buttons - removed Attribute
ReactionMenu.caller_buttons - removed Attribute
ReactionMenu.end_session_buttons - removed Attribute
ReactionMenu.go_to_page_buttons - removed
ReactionMenu.help_appear_order() - removed
ReactionMenu.change_appear_order() - removed Exception
SingleUseOnly - changed
ReactionMenu.clear_all_buttons()toReactionMenu.remove_all_buttons() - changed
ReactionMenu.all_can_reactis nowReactionMenu.all_can_click - changed Parameter
turn_everyin methodsReactionMenu.set_as_auto_paginator()andReactionMenu.update_turn_every()are now keyword only arguments - changed A lot of
ReactionMenuattributes are no longer property getters/setters. They are now normal attributes with type hints - changed The parameter for method
.get_menu_from_message()is now positional only - changed The following items now return only a
listinstead oflistorNone(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
- removed
ButtonsMenuclass- This has been replaced with
ViewMenu
- This has been replaced with
- changed The
ViewMenu.update()method arguments are now keyword only - removed
ComponentsButtonclass- This has been replaced with
ViewButton
- This has been replaced with
- changed All
ComponentsButtonfactory methods. They've been renamed and are now apart of theViewButtonclass- Old
ComponentsButton.basic_back()ComponentsButton.basic_next()
- New
ViewButton.back()ViewButton.next()
- Old
- changed The emojis attached to each menu have been moved to their own class
- Old
ReactionMenu.EMOJI_BACK_BUTTONReactionMenu.EMOJI_NEXT_BUTTON
- New
ReactionMenu.Emojis.BACK_BUTTONReactionMenu.Emojis.NEXT_BUTTON
- Old
- changed
ReactionButtonnames are now case sensitive if you were togeta button - changed Getting a button with
ReactionMenuhas been replaced by a new method- Old:
ReactionMenu.get_button_by_name(name: str) - New:
ReactionMenu.get_button(identity: Union[str, int], *, search_by='name'). This method now returns only alistof buttons instead of either a single button or multiple buttons
- Old:
- changed Setting the
ID_CALLERinformation is different now. See the documentation for proper implementation
- Added the ability to paginate through multiple pages in a single button press
ReactionButton(..., skip=ReactionButton.Skip(...))
- Added the ability for relay functions to relay only the buttons of your choice instead of relaying all buttons
ReactionMenu.set_relay(..., only: List[ReactionButton]=None)
- Added the ability to remove the call to a timeout method if you have one set
ReactionMenu.remove_on_timeout()
- Added the ability to add multiple pages/buttons to the menu at once
ReactionMenu.add_pages(pages: Sequence[Union[discord.Embed, str]])ReactionMenu.add_buttons(buttons: Sequence[ReactionButton])
- Added parameter
replyto thestartmethod. Enables the menu message to reply to the message that triggered itReactionMenu.start(..., reply: bool=False)
- Added property
ReactionMenu.last_viewed. Returns the last page that was seen by the user in the pagination process - Added the ability to use a message ID/message object to add the specified message's content into a menu
ReactionMenu.add_from_ids(messageable: discord.abc.Messageable, message_ids: Sequence[int])ReactionMenu.add_from_messages(messages: Sequence[discord.Message])
- Added the ability to separate embeds and strings
Reactionmenu.separate(values: Sequence[Any])
- Added the ability to test whether all items in a sequence are of type
discord.EmbedorstrReactionMenu.all_embeds(values: Sequence[Any])ReactionMenu.all_strings(values: Sequence[Any])
- Added the ability to filter all active
ReactionMenu's andViewMenu's into two separate listsReactionMenu.split_sessions()
- Added the ability to stop all
ReactionMenu's orViewMenu'sReactionMenu.stop_only(session_type: str)
- Added a method that allows you to set the page director style from a set of pre-defined styles
ReactionMenu.set_page_director_style(style_id: int)
- Added factory methods for
ReactionButtonReactionButton.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)
- Added attribute
ReactionMenu.remove_extra_emojis
- Added factory methods for
ViewButtonViewButton.link(label: str, url: str)ViewButton.skip(label: str, action: str, amount: int)
- Added methods to set all button styles
ViewMenu.randomize_button_styles()ViewMenu.set_button_styles(style: discord.ButtonStyle)
ViewButtonnow has anameattribute- Added the ability for method
ViewMenu.get_button()to get buttons by nameViewMenu.get_button(..., search_by='name')
ReactionButton&ViewButtonattributelast_clickednow supports an awaredatetime.datetime- The
send_toparameter in method.start()now supports threads - Method
.set_on_timeout()now raisesIncorrectTypeinstead ofMenuExceptionif the parameter given was not callable - Method
ReactionMenu.add_button()now also raisesMenuSettingsMismatch - Method
ReactionMenu.refresh_auto_pagination_data()now raises an error if no data was given in it's parameter - Added new exceptions.
ViewMenuExceptionandMenuException. All library exceptions can be caught usingMenuException - Added function
reactionmenu.version_info(). Used if submitting a GitHub issue - Added dunder methods for the library itself and a class
__all__forreactionmenu(from reactionmenu import *)__repr__forViewButton.Followup
For v1.0.9 - v2.0.4, the following displays what each acronym represents
BM=ButtonsMenuRM=ReactionMenuTM=TextMenu
Click to display changelog
RM|TMTheButtonclass now has similar attributes toComponentsButtonButton.menuButton.clicked_byButton.total_clicksButton.last_clicked
BM|RM|TMReactionMenu.EMOJI_END_SESSIONis now ⏹️ instead of ❌
Click to display changelog
BMAdded the ability to disable or remove a button from the menu when it has been clicked x amount of times
Click to display changelog
- Not a new feature, but Discord has increased the embed description length limit from 2048 to 4096. Exception
DescriptionOversized, typically raised when using a dynamic menu and the amount ofrows_requestedis too large for the amount of information received, has been updated to reflect that change BMAddedComponentsButton.ID_CUSTOM_EMBEDforComponentsButton. Buttons that go to the specified embed when clicked and are not apart of the normal pagination processBMAdded the ability to get theButtonsMenuinstance from aComponentsButtonComponentsButton.menu
BMAdded the ability to call a function when buttons are pressedButtonsMenu.set_relay()ButtonsMenu.remove_relay()
RM|TMAdded the ability to remove relays that have been setReactionMenu.remove_relay()
BMFixed an issue where a button withComponentsButton.ID_CALLERcould not call discord.py command functionsBMFixes for methodButtonsMenu.update()- Fixed an issue where if a button with
ComponentsButton.ID_CALLERorComponentsButton.ID_SEND_MESSAGEwas already registered to the menu and an attempt to reuse that button during aButtonsMenu.update()call, an error would occur - Fixed an issue where if a menu was updated and there were no
new_pages, the page index value would still be from before the update, and clicking a back/next button would go to the wrong page - Fixed an issue where if a menu was updated and there were
new_pages(embeds) that contained footers, the footer information would be removed
- Fixed an issue where if a button with
Click to display changelog
- Added new type of menu (
ButtonsMenu). Discords new Buttons feature RM|TMAdded the ability to call a function upon menu timeoutReactionMenu.set_on_timeout(func: object)
RM|TMAdded the ability to get the menu object from a message IDReactionMenu.get_menu_from_message(message_id: int)
RM|TMAdded the ability to set menu session limits per guild, channel, or member (before you could only set per guild)RM|TMAdded the ability to remove limits that have been setReactionMenu.remove_limit()
RM|TMAdded the ability to access thediscord.Memberobject of the person that started the menuReactionMenu.owner
RM|TMAddedownerto__repr__RM|TMAdded the ability to get all active DM sessionsReactionMenu.get_all_dm_sessions()
Click to display changelog
- Added new type of reaction menu (
TextMenu). Just like the normal reaction menu but no embeds are involved, only plain text is used.TextMenuhas limited options compared toReactionMenu - Added auto-pagination. The ability for the menu to turn pages on it's own. In addition to this, the
ReactionMenuconstructorsback_buttonandnext_buttonparameters can now be set toNoneif you intend to set the menu as an auto-pagination menuReactionMenu.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_everyReactionMenu.auto_paginator
- Added basic emojis. Used as in-house helper variables to set your
back_button/next_buttonparameters inReactionMenu/TextMenuas well as theemojiparameter inButtonReactionMenu.EMOJI_NEXT_BUTTONReactionMenu.EMOJI_BACK_BUTTONReactionMenu.EMOJI_FIRST_PAGEReactionMenu.EMOJI_LAST_PAGEReactionMenu.EMOJI_GO_TO_PAGEReactionMenu.EMOJI_END_SESSION
- Added the ability for a menu to be interacted with in direct messages. If a menu session is in a direct message, the following settings are disabled/changed because of discord limitations and resource/safety reasons:
ReactionMenu.clear_reactions_after(set toFalse)ReactionMenu.navigation_speed(set toReactionMenu.FAST)ReactionMenu.delete_interactions(set toFalse)ReactionMenu.only_roles(set toNone)ReactionMenu.timeout(set to60.0if set toNone)ReactionMenu.auto_paginator(set toFalse)
- Added the ability to track how long a menu session has been active
ReactionMenu.run_time
- Added the ability to set if only members with certain roles can control the menu
ReactionMenu.only_roles
- Added the ability to access the
discord.Messageobject the menu is operating fromReactionMenu.message
- Added the ability to gracefully stop all running menu's
ReactionMenu.stop_all_sessions()
- Added the ability to stop a specific menu by it's name
ReactionMenu.stop_session(name: str, include_all=False)
- Added the ability to get a session by it's name
ReactionMenu.get_session(name: str)
- Added the ability to get all active sessions
ReactionMenu.get_all_sessions()
- Added the ability for a menu reaction press to call other functions with the information of who pressed the reaction, what reaction was pressed, the time it was pressed, and the menu's object
ReactionMenu.set_relay(func)
- Added
__repr__forReactionMenu - Added documentation (doc strings) to a lot more properties to easily see what it does and what the return type is
- Added new error types:
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 registered
-
Fixed an issue where it was possible to call
ReactionMenu.set_main_pages()andReactionMenu.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 propertiesReactionMenu.default_back_buttonorReactionMenu.default_next_button, an error would occur. In addition, if other buttons were added to the menu afterReactionMenu.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 afterReactionMenu.clear_all_buttons()was called. AccessingReactionMenu.default_back_buttonorReactionMenu.default_next_buttonnow returns the true default back/next buttons (the buttons set in theReactionMenuconstructor), 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_tokwarg in methodReactionMenu.start(). Using aButtonwithButtonType.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
namekwarg 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
- removed
ReactionMenu.cancel_all_sessions()- Before this update,
.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 methodReactionMenu.stop_all_sessions()provides a much cleaner way to end all processing for active menus
- Before this update,
- changed Some property return types
- There were some properties that would return an empty list if there were no items in their associated list. With
v1.0.9, the below properties now returnNoneinstead of an empty list if their list contains no items ReactionMenu.all_buttonsReactionMenu.next_buttonsReactionMenu.back_buttons
- There were some properties that would return an empty list if there were no items in their associated list. With
Click to display changelog
- Fixed an issue where if a menu's timeout was set to
Noneand thenavigation_speedwas set toReactionMenu.FAST, an error would occur
Click to display changelog
- Added the ability to start a menu in a specific channel
- Fixed an issue where custom embeds in a dynamic menu would not display all implemented values from that embed
Click to display changelog
- Added
ReactionMenukwargnavigation_speed. Used with the below class attributesReactionMenu.NORMALReactionMenu.FAST
-
Fixed an issue where if multiple menu instances were created and stopped in a single execution, calling
ReactionMenu.stop()could stop the wrong instance -
Fixed an issue where if an exception was to occur during the startup of a menu, exceptions such as discord.py's "missing permissions" exception would be suppressed and not be displayed
-
Fixed an issue with
Buttonobjects where a duplicate name/emoji could be used
Click to display changelog
- Small additional update for
v1.0.3. Support for@client.command()functions to be used withButtonType.CALLER
Click to display changelog
- Added the ability for buttons to call functions
- Added new
ButtonType(ButtonType.CALLER) - Added class method
ButtonType.caller_details()
- Fixed an issue where all exceptions were suppressed specifically inside the execution method
Click to display changelog
- Added class method
ReactionMenu.get_sessions_count() - Added the option to delete the messages sent when interacting with the menu via
ButtonType.GO_TO_PAGE(ReactionMenukwargdelete_interactions). Repeatedly usingButtonType.GO_TO_PAGEcan sometimes make the chat look like spam
Click to display changelog
- Added the ability to limit the amount of active menu sessions
ReactionMenu.set_sessions_limit()
- Added new
ButtonType(ButtonType.GO_TO_PAGE) - Added
go_to_page_buttonsproperty - Added
total_pagesproperty - Added class method
ReactionMenu.cancel_all_sessions()(removed sincev1.0.9)