mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-07 10:22:59 +00:00
Change View callback order to (self, interaction, item)
This is more consistent with the rest of the library which always has the interaction as the first parameter. This has been done before in the command extension as well, the first parameter is always either self or the context.
This commit is contained in:
@ -17,15 +17,15 @@ class PersistentView(discord.ui.View):
|
||||
super().__init__(timeout=None)
|
||||
|
||||
@discord.ui.button(label='Green', style=discord.ButtonStyle.green, custom_id='persistent_view:green')
|
||||
async def green(self, button: discord.ui.Button, interaction: discord.Interaction):
|
||||
async def green(self, interaction: discord.Interaction, button: discord.ui.Button):
|
||||
await interaction.response.send_message('This is green.', ephemeral=True)
|
||||
|
||||
@discord.ui.button(label='Red', style=discord.ButtonStyle.red, custom_id='persistent_view:red')
|
||||
async def red(self, button: discord.ui.Button, interaction: discord.Interaction):
|
||||
async def red(self, interaction: discord.Interaction, button: discord.ui.Button):
|
||||
await interaction.response.send_message('This is red.', ephemeral=True)
|
||||
|
||||
@discord.ui.button(label='Grey', style=discord.ButtonStyle.grey, custom_id='persistent_view:grey')
|
||||
async def grey(self, button: discord.ui.Button, interaction: discord.Interaction):
|
||||
async def grey(self, interaction: discord.Interaction, button: discord.ui.Button):
|
||||
await interaction.response.send_message('This is grey.', ephemeral=True)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user