I am brand new to using discord buttons. This command is just a test command to see how everything works. My problem is that the buttons work but I can only press them once. after I press them once and then press them again I get the error at the bottom of the button saying "This interaction failed". how could I have the buttons be pressed as much as the user wants to? My Code is below. Any help would be great!
Code:
@commands.command()
async def button(self, ctx):
await ctx.send("This is a button test", components=[Button(style=ButtonStyle.blue, label="Btn1"), Button(style=ButtonStyle.red, label="Btn2"), Button(style=ButtonStyle.grey, label="Btn3")])
res = await self.client.wait_for("button_click")
if res.channel == ctx.channel:
await res.respond(type=InteractionType.ChannelMessageWithSource, content=f"{res.component.label} has been clicked! this is button 1")
res2 = await self.client.wait_for("button_click")
if res2.channel == ctx.channel:
await res2.respond(type=InteractionType.ChannelMessageWithSource, content=f"{res2.component.label} has been clicked! this is button 2")
res3 = await self.client.wait_for("button_click")
if res3.channel == ctx.channel:
await res3.respond(type=InteractionType.ChannelMessageWithSource, content=f"{res3.component.label} has been clicked! this is button 3")