Reactionmenu Versions Save

A library to create a discord.py 2.0+ paginator. Supports pagination with buttons, reactions, and category selection using selects.

v2.0.4

2 years ago

Key

  • BM = ButtonsMenu
  • RM = ReactionMenu
  • TM = TextMenu

Bug Fixes

  • BM Fixed an issue where multiple link buttons couldn't be used

v2.0.3

2 years ago

Key

  • BM = ButtonsMenu
  • RM = ReactionMenu
  • TM = TextMenu

New Features

  • RM|TM The Button class now has similar attributes to ComponentsButton
    • Button.menu
    • Button.clicked_by
    • Button.total_clicks
    • Button.last_clicked
  • BM|RM|TM ReactionMenu.EMOJI_END_SESSION is now ⏹️ instead of ❌

v2.0.2

2 years ago

Key

  • BM = ButtonsMenu
  • RM = ReactionMenu
  • TM = TextMenu

New Features

  • BM Added the ability to disable or remove a button from the menu when it has been clicked x amount of times

v2.0.1

2 years ago

Key

  • BM = ButtonsMenu
  • RM = ReactionMenu
  • TM = TextMenu

New Features

  • 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 of rows_requested is too large for the amount of information received, has been updated to reflect that change
  • BM Added ComponentsButton.ID_CUSTOM_EMBED for ComponentsButton. Buttons that go to the specified embed when clicked and are not apart of the normal pagination process
  • BM 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()

Bug Fixes

  • BM Fixed an issue where a button with ComponentsButton.ID_CALLER could not call discord.py command functions
  • BM Fixes for method ButtonsMenu.update()
    • Fixed an issue where if a button with 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 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

v2.0.0

2 years ago

Key

  • BM = ButtonsMenu
  • RM = ReactionMenu
  • TM = TextMenu

New Features

  • Added new type of menu (ButtonsMenu). Discords new Buttons feature
  • RM|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()

v1.0.9

3 years ago

New Features

  • 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 to ReactionMenu (docs)
  • Added auto-pagination. The ability for the menu to turn pages on it's own. In addition to this, the 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
  • Added basic emojis. Used as in-house helper variables to set your 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
  • 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 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)
  • Added the ability to track how long a menu session has been active (docs)
    • ReactionMenu.run_time
  • Added the ability to set if only members with certain roles can control the menu (docs)
    • ReactionMenu.only_roles
  • Added the ability to access the discord.Message object the menu is operating from (docs)
    • ReactionMenu.message
  • Added the ability to gracefully stop all running menu's (docs)
    • ReactionMenu.stop_all_sessions()
  • Added the ability to stop a specific menu by it's name (docs)
    • ReactionMenu.stop_session(name: str, include_all=False)
  • Added the ability to get a session by it's name (docs)
    • ReactionMenu.get_session(name: str)
  • Added the ability to get all active sessions (docs)
    • 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 (docs)
    • ReactionMenu.set_relay(func)
  • Added __repr__ for ReactionMenu
  • 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

Bug Fixes

  • Fixed 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

Breaking Change

  • 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 method ReactionMenu.stop_all_sessions() provides a much cleaner way to end all processing for active menus
  • 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 return None instead of an empty list if their list contains no items
    • ReactionMenu.all_buttons
    • ReactionMenu.next_buttons
    • ReactionMenu.back_buttons

v1.0.8

3 years ago
  • Added ReactionMenu.delete_on_timeout

v1.0.7

3 years ago
  • Fixed an issue where if a menu's timeout was set to None and the navigation_speed was set to ReactionMenu.FAST, an error would occur

v1.0.6

3 years ago
  • Added the ability to start a menu in a specific channel
  • Fixed a bug where custom embeds in a dynamic menu would not display all implemented values from that embed

v1.0.5

3 years ago
  • Added class variable ReactionMenu.NORMAL
  • Added class variable ReactionMenu.FAST
  • Added ReactionMenu kwarg "navigation_speed". Used with either ReactionMenu.NORMAL or ReactionMenu.FAST
  • Fixed a bug where if multiple menu instances were created and stopped in a single execution, calling ReactionMenu.stop() could stop the wrong instance
  • Fixed a bug 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 a bug with Button objects where a duplicate name/emoji could be used