-
-
Notifications
You must be signed in to change notification settings - Fork 482
Open
Labels
unconfirmed bugA bug report that needs triagingA bug report that needs triaging
Description
Summary
Buttons change behaviour when the same view is used multiple times
Reproduction Steps
- Run the code
- Click the buttons in the second response
Minimal Reproducible Code
import discord
bot = discord.Bot(intents=discord.Intents.default())
@bot.slash_command()
async def greet(ctx):
await ctx.respond(view=TestView(), ephemeral=True)
await ctx.respond(view=TestView(), ephemeral=True)
class TestView(discord.ui.View):
def __init__(self):
super().__init__(timeout=None)
@discord.ui.button(label="Row 2", row=2)
async def button_callback2(self, button, interaction):
await interaction.respond("Row 2", ephemeral=True)
@discord.ui.button(label="No Row")
async def button_callback3(self, button, interaction):
await interaction.respond("No Row", ephemeral=True)
bot.run("")
Expected Results
The buttons should respond like in the first message.
Actual Results
The buttons swap their behaviour, but they are visually aligned like in the first message.
Intents
discord.Intents.default
System Information
- Python v3.13.3-final
- py-cord v2.7.None-candidate
- py-cord importlib.metadata: v2.7.0rc2.dev67+gd5d162ac5
- aiohttp v3.12.15
- system info: Windows 11 10.0.26100
Checklist
- I have searched the open issues for duplicates.
- I have shown the entire traceback, if possible.
- I have removed my token from display, if visible.
Additional Context
The buttons in first message work as expected, but when the view is used the second time, the buttons show the wrong output
- When switching the order of callbacks, it fixes this scenario
- Passing
row=1
to the top button also fixes the issue here
Metadata
Metadata
Assignees
Labels
unconfirmed bugA bug report that needs triagingA bug report that needs triaging