@@ -15,10 +15,8 @@ def __init__(self, *,
15
15
ephemeral : bool = False ) -> None :
16
16
self .bot = bot
17
17
self .ephemeral = ephemeral
18
-
18
+ self . current_page = 0
19
19
self .pages = None
20
- self .message = None
21
- self .current_page = None
22
20
self .total_page_count = None
23
21
24
22
super ().__init__ (timeout = timeout )
@@ -35,7 +33,6 @@ async def start(self, ctx: discord.Interaction, pages: list[discord.Embed]):
35
33
self .pages = pages
36
34
self .total_page_count = len (pages )
37
35
self .ctx : discord .Interaction = ctx
38
- self .current_page = 0
39
36
if self .total_page_count == 1 :
40
37
self .next .disabled = True
41
38
self .previous .disabled = True
@@ -52,7 +49,7 @@ def handle_buttons(self):
52
49
self .next .disabled = self .current_page == self .total_page_count - 1
53
50
54
51
@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 , _ ):
56
53
if interaction .user != self .ctx .user :
57
54
embed = discord .Embed (description = "You cannot control this pagination because you did not execute it." ,
58
55
color = discord .Colour .red ())
@@ -63,7 +60,7 @@ async def first(self, interaction: discord.Interaction, button: discord.Button):
63
60
await interaction .response .edit_message (embed = self .pages [self .current_page ], view = self )
64
61
65
62
@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 , _ ):
67
64
if interaction .user != self .ctx .user :
68
65
embed = discord .Embed (description = "You cannot control this pagination because you did not execute it." ,
69
66
color = discord .Colour .red ())
@@ -78,7 +75,7 @@ async def counter(self, interaction: discord.Interaction, button: discord.Button
78
75
pass
79
76
80
77
@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 , _ ):
82
79
if interaction .user != self .ctx .user :
83
80
embed = discord .Embed (description = "You cannot control this pagination because you did not execute it." ,
84
81
color = discord .Colour .red ())
@@ -89,7 +86,7 @@ async def next(self, interaction: discord.Interaction, button: discord.Button):
89
86
await interaction .response .edit_message (embed = self .pages [self .current_page ], view = self )
90
87
91
88
@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 , _ ):
93
90
if interaction .user != self .ctx .user :
94
91
embed = discord .Embed (description = "You cannot control this pagination because you did not execute it." ,
95
92
color = discord .Colour .red ())
0 commit comments