From cb7290be009268b2e87da02da976b7ca1546995c Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Thu, 7 Jun 2018 23:06:25 -0800 Subject: [PATCH] Fixed number checker --- src/imports/utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/imports/utils.py b/src/imports/utils.py index 5387f4c..ace5a33 100644 --- a/src/imports/utils.py +++ b/src/imports/utils.py @@ -380,15 +380,16 @@ class Book: elif str(reaction.emoji) == self._bot.book_emojis['start']: self._current_page = 0 elif str(reaction.emoji) == self._bot.book_emojis['hash']: - m = await self._channel.send(f'Please enter a number between 1 and {self._len_pages}') + m = await self._channel.send(f'Please enter a number in range 1 to {self._len_pages}') + def num_check(message): if self._locked: return message.content.isdigit() \ - and 0 < int(message.content) < self._len_pages \ - and message.author == self._calling_message.author + and 0 < int(message.content) <= self._len_pages \ + and message.author == self._calling_message.author else: return message.content.isdigit() \ - and 0 < int(message.content) < self._len_pages + and 0 < int(message.content) <= self._len_pages try: msg = await self._bot.wait_for('message', timeout=30, check=num_check)