- Fixed an issue where
ViewSelect.GoTo
allowed all users to control the menu (#57)
Click to display changelog
- Added method
Page.from_embeds()
- In a
ViewSelect
, thediscord.SelectOption
parameterdefault
can 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
pip
installing the library
Click to display changelog
- Fixed an issue where a
ViewMenu
would 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
ctx
has been changed tomethod
forReactionMenu
&ViewMenu
constructor and is now positional only - Parameter
menu_type
forReactionMenu
&ViewMenu
constructor is now keyword only - The auto-paginate feature for
ReactionMenu
has been removed - The
Page
class has been added. Represents each "page" added via.add_page()
/.add_pages()
- Using
.last_viewed
now returns aPage
..pages
now 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 allViewMenu
sessions instead of allReactionMenu
sessions as well asViewMenu
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()
- 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_buttons
anddisable_buttons
have been removed from methodViewMenu.stop()
. With the addition of selects, the following new parameters will now take their placeremove_items
disable_items
- The following attributes have been renamed in the
ViewMenu
classdisable_buttons_on_timeout
→disable_items_on_timeout
remove_buttons_on_timeout
→remove_items_on_timeout
- Method
.add_from_messages()
is no longerasync
- Fixed an issue where
ViewButton
link buttons would be removed even after setting it as persistent - Using the
reply
kwarg forReactionMenu
in 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
separator
parameter.set_page_director_style(..., separator=DEFAULT)
- Added support for voice channels to be utilized via the
send_to
parameter in the.start()
method.
- Added the ability to use a select to go to a page instead of using text input
- Added the
persist
kwarg 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 allViewSelect
associated with the menu
- Added exception
SelectNotFound
- The
Page
class has been added to__init__
and is now available for use - If the
method
parameter in either theReactionMenu
orViewMenu
constructor is of the wrong type,IncorrectType
is 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
persist
kwarg 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 allViewMenu
sessions instead of allReactionMenu
sessions andViewMenu
sessions. This is done with the addition of thefixed
parameter for the following methods. If you like the old behavior, simply set thefixed
parameter 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 (
ReactionMenu
only)
- Added method
wait_until_close()
Click to display changelog
- With the discontinuation of discord.py, this library is now dependent on pycord
- changed
ReactionMenu.STATIC
andReactionMenu.DYNAMIC
have been renamed- Old:
ReactionMenu.STATIC
- New:
ReactionMenu.TypeEmbed
- Old:
ReactionMenu.DYNAMIC
- New:
ReactionMenu.TypeEmbedDynamic
- Old:
- changed/removed The parameters of
ReactionMenu
have been changed- Old:
ReactionMenu(ctx, back_button='⬅️', next_button='➡️', config=ReactionMenu.STATIC)
- New:
ReactionMenu(ctx, menu_type=ReactionMenu.TypeEmbed)
- Old:
- changed/removed
ReactionMenu
andTextMenu
are no longer separate classes.TextMenu
has been merged intoReactionMenu
. You can use a text menu by doing the followingReactionMenu(..., menu_type=ReactionMenu.TypeText)
- changed The
Button
class has been renamed toReactionButton
to avoid compatibility issues with pycord 2.0 - changed
ButtonType
has been moved and setting thelinked_to
of 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
ReactionMenu
parametersback_button
andnext_button
have been removed. UseReactionMenu.add_button()
instead - removed
ReactionMenu
parameterconfig
has 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.buttons
instead - 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_react
is nowReactionMenu.all_can_click
- changed Parameter
turn_every
in methodsReactionMenu.set_as_auto_paginator()
andReactionMenu.update_turn_every()
are now keyword only arguments - changed A lot of
ReactionMenu
attributes 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
list
instead oflist
orNone
(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
ButtonsMenu
class- This has been replaced with
ViewMenu
- This has been replaced with
- changed The
ViewMenu.update()
method arguments are now keyword only - removed
ComponentsButton
class- This has been replaced with
ViewButton
- This has been replaced with
- changed All
ComponentsButton
factory methods. They've been renamed and are now apart of theViewButton
class- 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_BUTTON
ReactionMenu.EMOJI_NEXT_BUTTON
- New
ReactionMenu.Emojis.BACK_BUTTON
ReactionMenu.Emojis.NEXT_BUTTON
- Old
- changed
ReactionButton
names are now case sensitive if you were toget
a button - changed Getting a button with
ReactionMenu
has 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 alist
of buttons instead of either a single button or multiple buttons
- Old:
- changed Setting the
ID_CALLER
information 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
reply
to thestart
method. 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.Embed
orstr
ReactionMenu.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
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)
- Added attribute
ReactionMenu.remove_extra_emojis
- Added factory methods for
ViewButton
ViewButton.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)
ViewButton
now has aname
attribute- Added the ability for method
ViewMenu.get_button()
to get buttons by nameViewMenu.get_button(..., search_by='name')
ReactionButton
&ViewButton
attributelast_clicked
now supports an awaredatetime.datetime
- The
send_to
parameter in method.start()
now supports threads - Method
.set_on_timeout()
now raisesIncorrectType
instead ofMenuException
if 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.
ViewMenuException
andMenuException
. 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
=ButtonsMenu
RM
=ReactionMenu
TM
=TextMenu
Click to display changelog
RM|TM
TheButton
class now has similar attributes toComponentsButton
Button.menu
Button.clicked_by
Button.total_clicks
Button.last_clicked
BM|RM|TM
ReactionMenu.EMOJI_END_SESSION
is now ⏹️ instead of ❌
Click to display changelog
BM
Added 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_requested
is too large for the amount of information received, has been updated to reflect that change BM
AddedComponentsButton.ID_CUSTOM_EMBED
forComponentsButton
. Buttons that go to the specified embed when clicked and are not apart of the normal pagination processBM
Added the ability to get theButtonsMenu
instance from aComponentsButton
ComponentsButton.menu
BM
Added the ability to call a function when buttons are pressedButtonsMenu.set_relay()
ButtonsMenu.remove_relay()
RM|TM
Added the ability to remove relays that have been setReactionMenu.remove_relay()
BM
Fixed an issue where a button withComponentsButton.ID_CALLER
could not call discord.py command functionsBM
Fixes for methodButtonsMenu.update()
- Fixed an issue where if a button with
ComponentsButton.ID_CALLER
orComponentsButton.ID_SEND_MESSAGE
was 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|TM
Added the ability to call a function upon menu timeoutReactionMenu.set_on_timeout(func: object)
RM|TM
Added the ability to get the menu object from a message IDReactionMenu.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 setReactionMenu.remove_limit()
RM|TM
Added the ability to access thediscord.Member
object of the person that started the menuReactionMenu.owner
RM|TM
Addedowner
to__repr__
RM|TM
Added 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.TextMenu
has limited options compared toReactionMenu
- Added auto-pagination. The ability for the menu to turn pages on it's own. In addition to this, the
ReactionMenu
constructorsback_button
andnext_button
parameters can now be set toNone
if 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_every
ReactionMenu.auto_paginator
- Added basic emojis. Used as in-house helper variables to set your
back_button
/next_button
parameters inReactionMenu
/TextMenu
as well as theemoji
parameter inButton
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
- 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.0
if 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.Message
object 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_button
orReactionMenu.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_button
orReactionMenu.default_next_button
now returns the true default back/next buttons (the buttons set in theReactionMenu
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 methodReactionMenu.start()
. Using aButton
withButtonType.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
- 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 returnNone
instead of an empty list if their list contains no items ReactionMenu.all_buttons
ReactionMenu.next_buttons
ReactionMenu.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
None
and thenavigation_speed
was 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
ReactionMenu
kwargnavigation_speed
. Used with the below class attributesReactionMenu.NORMAL
ReactionMenu.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
Button
objects 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
(ReactionMenu
kwargdelete_interactions
). Repeatedly usingButtonType.GO_TO_PAGE
can 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_buttons
property - Added
total_pages
property - Added class method
ReactionMenu.cancel_all_sessions()
(removed sincev1.0.9
)