modules/utils/paginator.py
async def numbered_page(self):
        """lets you type a page number to go to"""
        # noinspection PyListCreation
        to_delete = []
        to_delete.append(await self.channel.send('What page do you want to go to?'))

        def message_check(m):
            return m.author == self.author and self.channel == m.channel and m.content.isdigit()

        try:
            msg = await self.bot.wait_for('message', check=message_check, timeout=30.0)
        except asyncio.TimeoutError:
            to_delete.append(await self.channel.send('Took too long.'))
            await asyncio.sleep(5)
        else:
            page = int(msg.content)
            to_delete.append(msg)
            if page != 0 and page <= self.maximum_pages:
                await self.show_page(page)
            else:
                to_delete.append(await self.channel.send(f'Invalid page given, please try again. ({page}/{self.maximum_pages})'))
                await asyncio.sleep(5)

        # noinspection PyBroadException
        try:
            await self.channel.delete_messages(to_delete)
        except Exception:
            pass
lets you type a page number to go to
lets you type a page number to go to
lets you type a page number to go to
async def numbered_page(self):
        to_delete = []
        to_delete.append(await self.channel.send('What page do you want to go to?'))
        def message_check(m):
            return m.author == self.author and self.channel == m.channel and m.content.isdigit()
        try:
            msg = await self.bot.wait_for('message', check=message_check, timeout=30.0)
        except asyncio.TimeoutError:
            to_delete.append(await self.channel.send('Took too long.'))
            await asyncio.sleep(5)
        else:
            page = int(msg.content)
            to_delete.append(msg)
            if page != 0 and page <= self.maximum_pages:
                await self.show_page(page)
            else:
                to_delete.append(await self.channel.send(f'Invalid page given, please try again. ({page}/{self.maximum_pages})'))
                await asyncio.sleep(5)
        try:
            await self.channel.delete_messages(to_delete)
        except Exception:
            pass
async def numbered_page ( self ) : to_delete = [ ] to_delete . append ( await self . channel . send ( 'What page do you want to go to?' ) ) def message_check ( m ) : return m . author == self . author and self . channel == m . channel and m . content . isdigit ( ) try : msg = await self . bot . wait_for ( 'message' , check = message_check , timeout = 30.0 ) except asyncio . TimeoutError : to_delete . append ( await self . channel . send ( 'Took too long.' ) ) await asyncio . sleep ( 5 ) else : page = int ( msg . content ) to_delete . append ( msg ) if page != 0 and page <= self . maximum_pages : await self . show_page ( page ) else : to_delete . append ( await self . channel . send ( f'Invalid page given, please try again. ({page}/{self.maximum_pages})' ) ) await asyncio . sleep ( 5 ) try : await self . channel . delete_messages ( to_delete ) except Exception : pass
lets you type a page number to go to
lets you type a page number to go to
"""lets you type a page number to go to""" # noinspection PyListCreation # noinspection PyBroadException
self