Changed usages of emoji.name to str(emoji) since for custom emoji, emoji.name will return just the name (eg. pagefirst), but str(emoji) will return the full emoji (eg. <:pagefirst:899973860772962344>).
When overriding the emoji, the full emoji will need to be specified, so this allows the use of custom emoji in ButtonMenuPages.
Usage of default emojis has been tested and it still works (it is not affected by this change).
Reaction Menus
Changed usage of @button decorator to calls to add_button in order to make it possible to use instance properties (eg. self.FIRST_PAGE) instead of having to use MenuPagesBase.FIRST_PAGE.
Example usage:
Button Menus
class CustomButtonMenuPages(menus.ButtonMenuPages):
FIRST_PAGE = "<:pagefirst:899973860772962344>"
PREVIOUS_PAGE = "<:pageprev:899973860965888010>"
NEXT_PAGE = "<:pagenext:899973860840050728>"
LAST_PAGE = "<:pagelast:899973860810694686>"
STOP = "<:stop:899973861444042782>"
# starting the menu
pages = CustomButtonMenuPages(source=MySource(range(1, 100)))
await pages.start(ctx)
Reaction Menus
class CustomMenuPages(menus.MenuPages):
FIRST_PAGE = "<:pagefirst:899973860772962344>"
PREVIOUS_PAGE = "<:pageprev:899973860965888010>"
NEXT_PAGE = "<:pagenext:899973860840050728>"
LAST_PAGE = "<:pagelast:899973860810694686>"
STOP = "<:stop:899973861444042782>"
# starting the menu
pages = CustomMenuPages(source=MySource(range(1, 100)))
await pages.start(ctx)
Button Menus
Changed usages of
emoji.name
tostr(emoji)
since for custom emoji,emoji.name
will return just the name (eg.pagefirst
), butstr(emoji)
will return the full emoji (eg.<:pagefirst:899973860772962344>
).When overriding the emoji, the full emoji will need to be specified, so this allows the use of custom emoji in ButtonMenuPages.
Usage of default emojis has been tested and it still works (it is not affected by this change).
Reaction Menus
Changed usage of
@button
decorator to calls toadd_button
in order to make it possible to use instance properties (eg.self.FIRST_PAGE
) instead of having to useMenuPagesBase.FIRST_PAGE
.Example usage:
Button Menus
Reaction Menus