From 3700ab2344d21d0e1f32d263501ad12185471b23 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Wed, 6 Jun 2018 17:18:38 -0800 Subject: [PATCH] adjust Book --- exts/imports/utils.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/exts/imports/utils.py b/exts/imports/utils.py index 835126d..dc07e65 100644 --- a/exts/imports/utils.py +++ b/exts/imports/utils.py @@ -209,16 +209,16 @@ class Paginator: class Book: - def __init__(self, pag: Paginator, ctx: discord.ext.commands.Context): + def __init__(self, pag: Paginator, ctx: typing.Tuple[discord.Message, + discord.TextChannel, + discord.ext.commands.Bot]): if pag == Paginator(): raise RuntimeError('Cannot create a book out of an empty Paginator.') self._pages = pag.pages() self._len_pages = len(self._pages) self._current_page = 0 - self._message = ctx.message - self._channel = ctx.channel - self._bot = ctx.bot + self._message, self._channel, self._bot = ctx self._locked = True def advance_page(self, count: int=1): @@ -240,11 +240,11 @@ class Book: if not self._current_page < 10: await self._message.add_reaction(self._bot.unicode_emojis['rewind']) if not self._current_page == 0: - await self._message.add_reaction(self.bot.unicode_emojis['back']) + await self._message.add_reaction(self._bot.unicode_emojis['back']) if self._len_pages > 1: - await self._message.add_reaction(self.bot.unicode_emojis['hash']) + await self._message.add_reaction(self._bot.unicode_emojis['hash']) if not self._current_page == self._len_pages - 1: - await self._message.add_reaction(self.bot.unicode_emojis['forward']) + await self._message.add_reaction(self._bot.unicode_emojis['forward']) if not self._current_page > self._len_pages - 11: await self._message.add_reaction(self._bot.unicode_emojis['fast_forward']) if not self._current_page == self._len_pages - 1: