Skip to content

Commit 6751793

Browse files
committed
Clean up
1 parent 8418211 commit 6751793

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lib/pages/__init__.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ def __init__(self, *,
1515
ephemeral: bool = False) -> None:
1616
self.bot = bot
1717
self.ephemeral = ephemeral
18-
18+
self.current_page = 0
1919
self.pages = None
20-
self.message = None
21-
self.current_page = None
2220
self.total_page_count = None
2321

2422
super().__init__(timeout=timeout)
@@ -35,7 +33,6 @@ async def start(self, ctx: discord.Interaction, pages: list[discord.Embed]):
3533
self.pages = pages
3634
self.total_page_count = len(pages)
3735
self.ctx: discord.Interaction = ctx
38-
self.current_page = 0
3936
if self.total_page_count == 1:
4037
self.next.disabled = True
4138
self.previous.disabled = True
@@ -52,7 +49,7 @@ def handle_buttons(self):
5249
self.next.disabled = self.current_page == self.total_page_count - 1
5350

5451
@discord.ui.button(emoji=discord.PartialEmoji(name="\U000023ee"), disabled=True)
55-
async def first(self, interaction: discord.Interaction, button: discord.Button):
52+
async def first(self, interaction: discord.Interaction, _):
5653
if interaction.user != self.ctx.user:
5754
embed = discord.Embed(description="You cannot control this pagination because you did not execute it.",
5855
color=discord.Colour.red())
@@ -63,7 +60,7 @@ async def first(self, interaction: discord.Interaction, button: discord.Button):
6360
await interaction.response.edit_message(embed=self.pages[self.current_page], view=self)
6461

6562
@discord.ui.button(emoji=discord.PartialEmoji(name="\U000025c0"), disabled=True)
66-
async def previous(self, interaction: discord.Interaction, button: discord.Button):
63+
async def previous(self, interaction: discord.Interaction, _):
6764
if interaction.user != self.ctx.user:
6865
embed = discord.Embed(description="You cannot control this pagination because you did not execute it.",
6966
color=discord.Colour.red())
@@ -78,7 +75,7 @@ async def counter(self, interaction: discord.Interaction, button: discord.Button
7875
pass
7976

8077
@discord.ui.button(emoji=discord.PartialEmoji(name="\U000025b6"))
81-
async def next(self, interaction: discord.Interaction, button: discord.Button):
78+
async def next(self, interaction: discord.Interaction, _):
8279
if interaction.user != self.ctx.user:
8380
embed = discord.Embed(description="You cannot control this pagination because you did not execute it.",
8481
color=discord.Colour.red())
@@ -89,7 +86,7 @@ async def next(self, interaction: discord.Interaction, button: discord.Button):
8986
await interaction.response.edit_message(embed=self.pages[self.current_page], view=self)
9087

9188
@discord.ui.button(emoji=discord.PartialEmoji(name="\U000023ed"))
92-
async def last(self, interaction: discord.Interaction, button: discord.Button):
89+
async def last(self, interaction: discord.Interaction, _):
9390
if interaction.user != self.ctx.user:
9491
embed = discord.Embed(description="You cannot control this pagination because you did not execute it.",
9592
color=discord.Colour.red())

0 commit comments

Comments
 (0)