diff options
author | 2020-02-08 07:40:26 -0800 | |
---|---|---|
committer | 2020-02-09 09:13:47 -0800 | |
commit | 9efd88047ed9201ab6bb6077de10b39490b9434f (patch) | |
tree | c324b11dffeb375ff86b2ecd5b302c7414bfbfd2 | |
parent | Merge remote-tracking branch 'origin/master' into emoji-cleanup (diff) |
Remove clear reaction from paginators
It could be confused with the delete reaction. Clearing reactions
manually is rarely a useful feature anyway.
-rw-r--r-- | bot/cogs/help.py | 7 | ||||
-rw-r--r-- | bot/pagination.py | 12 |
2 files changed, 2 insertions, 17 deletions
diff --git a/bot/cogs/help.py b/bot/cogs/help.py index ecf14d131..fd5bbc3ca 100644 --- a/bot/cogs/help.py +++ b/bot/cogs/help.py @@ -14,7 +14,7 @@ from bot.bot import Bot from bot.constants import Channels, Emojis, STAFF_ROLES from bot.decorators import redirect_output from bot.pagination import ( - CLEAR_EMOJI, FIRST_EMOJI, LAST_EMOJI, + FIRST_EMOJI, LAST_EMOJI, LEFT_EMOJI, LinePaginator, RIGHT_EMOJI, ) @@ -25,7 +25,6 @@ REACTIONS = { LEFT_EMOJI: 'back', RIGHT_EMOJI: 'next', LAST_EMOJI: 'end', - CLEAR_EMOJI: 'clear', DELETE_EMOJI: 'stop', } @@ -499,10 +498,6 @@ class HelpSession: if not self.is_last_page: await self.update_page(len(self._pages)-1) - async def do_clear(self) -> None: - """Event that is called when the user clears the emojis from the pagination.""" - await self.message.clear_reactions() - async def do_stop(self) -> None: """Event that is called when the user requests to stop the help session.""" await self.message.delete() diff --git a/bot/pagination.py b/bot/pagination.py index a7938fe85..35870c040 100644 --- a/bot/pagination.py +++ b/bot/pagination.py @@ -12,10 +12,9 @@ FIRST_EMOJI = "\u23EE" # [:track_previous:] LEFT_EMOJI = "\u2B05" # [:arrow_left:] RIGHT_EMOJI = "\u27A1" # [:arrow_right:] LAST_EMOJI = "\u23ED" # [:track_next:] -CLEAR_EMOJI = "\u274c" # [:x:] DELETE_EMOJI = constants.Emojis.trashcan # [:trashcan:] -PAGINATION_EMOJI = [FIRST_EMOJI, LEFT_EMOJI, RIGHT_EMOJI, LAST_EMOJI, CLEAR_EMOJI, DELETE_EMOJI] +PAGINATION_EMOJI = [FIRST_EMOJI, LEFT_EMOJI, RIGHT_EMOJI, LAST_EMOJI, DELETE_EMOJI] log = logging.getLogger(__name__) @@ -206,10 +205,6 @@ class LinePaginator(Paginator): log.debug("Timed out waiting for a reaction") break # We're done, no reactions for the last 5 minutes - if reaction.emoji == CLEAR_EMOJI: - log.debug("Got clear reaction") - break - if str(reaction.emoji) == DELETE_EMOJI: log.debug("Got delete reaction") return await message.delete() @@ -395,11 +390,6 @@ class ImagePaginator(Paginator): # Deletes the users reaction await message.remove_reaction(reaction.emoji, user) - # Clear reaction press - [:x:] - if reaction.emoji == CLEAR_EMOJI: - log.debug("Got clear reaction") - break - # Delete reaction press - [:trashcan:] if str(reaction.emoji) == DELETE_EMOJI: log.debug("Got delete reaction") |