@@ -291,14 +291,14 @@ def update_buttons(self) -> Dict:
291
291
292
292
return self .buttons
293
293
294
- async def send (self , messageable : abc . Messageable , ephemeral : bool = False ) -> Union [discord .Message , discord .WebhookMessage ]:
294
+ async def send (self , ctx : Union [ ApplicationContext , Context ] , ephemeral : bool = False ) -> Union [discord .Message , discord .WebhookMessage ]:
295
295
"""Sends a message with the paginated items.
296
296
297
297
298
298
Parameters
299
299
------------
300
- messageable: :class:`discord.abc.Messageable`
301
- The messageable channel to send to .
300
+ ctx: Union[ :class:`~ discord.ext.commands.Context`, :class:`~discord.ApplicationContext`]
301
+ A command's invocation context .
302
302
ephemeral: :class:`bool`
303
303
Choose whether the message is ephemeral or not. Only works with slash commands.
304
304
@@ -308,24 +308,20 @@ async def send(self, messageable: abc.Messageable, ephemeral: bool = False) -> U
308
308
The message that was sent with the paginator.
309
309
"""
310
310
311
- if not isinstance (messageable , abc .Messageable ):
312
- raise TypeError ("messageable should be a subclass of abc.Messageable" )
313
-
314
311
page = self .pages [0 ]
315
312
316
- if isinstance (messageable , (ApplicationContext , Context )):
317
- self .user = messageable .author
313
+ self .user = ctx .author
318
314
319
- if isinstance (messageable , ApplicationContext ):
320
- msg = await messageable .respond (
315
+ if isinstance (ctx , ApplicationContext ):
316
+ msg = await ctx .respond (
321
317
content = page if isinstance (page , str ) else None ,
322
318
embed = page if isinstance (page , discord .Embed ) else None ,
323
319
view = self ,
324
320
ephemeral = ephemeral ,
325
321
)
326
322
327
323
else :
328
- msg = await messageable .send (
324
+ msg = await ctx .send (
329
325
content = page if isinstance (page , str ) else None ,
330
326
embed = page if isinstance (page , discord .Embed ) else None ,
331
327
view = self ,
0 commit comments