def on_reaction(self, event): if event.user_id == self.bot.client.state.me.id: return if event.emoji.name == Pages.prev_emoji: Pages.update(self.bot, event.channel_id, event.message_id, "PREV", event.user_id) elif event.emoji.name == Pages.next_emoji: Pages.update(self.bot, event.channel_id, event.message_id, "NEXT", event.user_id)
def on_reaction(self, event): if event.user_id == self.bot.client.state.me.id: return message = self.bot.client.api.channels_messages_get( event.channel_id, event.message_id) if event.emoji.name == Pages.prev_emoji: if Pages.update(message, "PREV", event.user_id): self.bot.client.api.channels_messages_reactions_delete( event.channel_id, event.message_id, Pages.prev_emoji, event.user_id) elif event.emoji.name == Pages.next_emoji: if Pages.update(message, "NEXT", event.user_id): self.bot.client.api.channels_messages_reactions_delete( event.channel_id, event.message_id, Pages.next_emoji, event.user_id)