diff --git a/Paginator/Paginate.py b/Paginator/Paginate.py index 6e93c26..ee212d0 100644 --- a/Paginator/Paginate.py +++ b/Paginator/Paginate.py @@ -76,7 +76,7 @@ class CreatePaginator(ui.View): def __init__(self, embeds, author_id: int = None, timeout: float = None): super().__init__( - timeout=None + timeout=timeout ) self.embeds = embeds self.author_id = author_id @@ -87,60 +87,3 @@ def __init__(self, embeds, author_id: int = None, timeout: float = None): disabled = True self.add_item(PreviousButton(True)) self.add_item(NextButton(disabled)) - -# class CreatePaginator(ui.View): -# """ -# Paginator for Embeds. -# Parameters: -# ---------- -# embeds: List[Embed] -# List of embeds which are in the Paginator. Paginator starts from first embed. -# author: int -# The ID of the author who can interact with the buttons. Anyone can interact with the Paginator Buttons if not specified. -# timeout: float -# How long the Paginator should timeout in, after the last interaction. - -# """ -# def __init__(self, embeds: list, author: int | None = None, timeout: float | None = None): -# if not timeout: -# super().__init__() -# else: -# super().__init__(timeout=timeout) -# self.embeds = embeds -# self.author = author -# self.CurrentEmbed = 0 - - - -# @ui.button(emoji="⬅️", style=ButtonStyle.grey) -# async def previous(self, button, inter): -# if not inter.response.is_done(): -# await inter.response.defer(ephemeral=True) -# try: -# if inter.author.id != self.author and self.author: -# return await inter.followup.send("You cannot interact with these buttons.", ephemeral=True) - -# if self.CurrentEmbed: -# await inter.followup.edit_message(embed=self.embeds[self.CurrentEmbed-1]) -# self.CurrentEmbed -= 1 -# else: -# raise ValueError("No previous embed available") - -# except Exception as e: -# self.logger.error(f"Error in Paginator 'previous': {e}") -# await inter.followup.send('Unable to change the page.', ephemeral=True) - -# @ui.button(emoji="➡️", style=ButtonStyle.grey) -# async def next(self, button, inter): -# if not inter.response.is_done(): -# await inter.response.defer(ephemeral=True) -# try: -# if inter.author.id != self.author and self.author != 123: -# return await inter.followup.send("You cannot interact with these buttons.", ephemeral=True) - -# await inter.followup.edit_message(embed=self.embeds[self.CurrentEmbed+1]) -# self.CurrentEmbed += 1 - -# except Exception as e: -# self.logger.error(f"Error in Paginator 'next': {e}") -# await inter.followup.send('Unable to change the page.', ephemeral=True) diff --git a/setup.py b/setup.py index 765c51e..b154276 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name="disnake-pagination", - version="2.0", + version="2.1", description="A simple Embed Paginator for your projects made with disnake.", long_description=long_description, long_description_content_type='text/markdown', @@ -13,7 +13,7 @@ url="https://github.com/DorianAarno/Paginator", author="Aarno Dorian", author_email="aarnodorian56@gmail.com", - download_url = "https://github.com/DorianAarno/Paginator/archive/refs/tags/v1.0.tar.gz", + download_url = "https://github.com/DorianAarno/Paginator/archive/refs/tags/v2.1.tar.gz", license = "MIT", classifiers=[ 'Intended Audience :: Developers', @@ -21,6 +21,7 @@ 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Topic :: Internet', 'Topic :: Software Development :: Libraries', 'Topic :: Software Development :: Libraries :: Python Modules',