Interaction Responding Error #78

Open
opened 2021-09-28 00:49:39 +00:00 by pandabear189 · 1 comment
pandabear189 commented 2021-09-28 00:49:39 +00:00 (Migrated from github.com)

Summary

When using interaction.response.send_message() and a ctx.send or blahblah_channel.send() if yo put the channel.send before it acts like an interaction and throws a already responded error

Reproduction Steps

I have a ticket_channel.send() then an interaction.response.send_message()
then when i press the button i get an error: interaction already responded to.

Minimal Reproducible Code

@discord.ui.button(label='\U0001f4e9 Create Ticket', custom_id="ticket", style=discord.ButtonStyle.secondary)
    async def ticket(self, button: discord.ui.Button, interaction: discord.Interaction):
        with open("data.json") as f:
            data = json.load(f)

            ticket_channel = await interaction.guild.create_text_channel("ticket-{}".format(ticket_number))


                    message_content = "Please wait and a moderator will assist you! To close this ticket press the `Close` button below"
                    em = discord.Embed(
                        title="New ticket from {}#{}".format(interaction.user.name, interaction.user.discriminator),
                        description=f"{message_content} {pinged_msg_content}", color=0x00a8ff)
                    view = Close()
                    await ticket_channel.send(embed=em, view=view)

                        em3 = discord.Embed(title="TMS Tickets",
                                            description="Your ticket has been created at {}".format(
                                                ticket_channel.mention),
                                            color=0x00a8ff)
                        await interaction.response.send_message(embed=em3, ephemeral=True)

Expected Results

It to work, and it to send the message to the ticket channel then respond to the interaction

Actual Results

It responds then sends the ticket message 2 times, and throws an error saying its already been responded to. (this is a persistent view btw)

Intents

discord.Intents.all()

System Information

Python v3.9.6-final

  • discord.py v2.0.0-alpha
    • discord.py pkg_resources: v2.0.0a3637+g0637a628
  • aiohttp v3.7.4.post0

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

No response

### Summary When using interaction.response.send_message() and a ctx.send or blahblah_channel.send() if yo put the channel.send before it acts like an interaction and throws a already responded error ### Reproduction Steps I have a ticket_channel.send() then an interaction.response.send_message() then when i press the button i get an error: interaction already responded to. ### Minimal Reproducible Code ```python @discord.ui.button(label='\U0001f4e9 Create Ticket', custom_id="ticket", style=discord.ButtonStyle.secondary) async def ticket(self, button: discord.ui.Button, interaction: discord.Interaction): with open("data.json") as f: data = json.load(f) ticket_channel = await interaction.guild.create_text_channel("ticket-{}".format(ticket_number)) message_content = "Please wait and a moderator will assist you! To close this ticket press the `Close` button below" em = discord.Embed( title="New ticket from {}#{}".format(interaction.user.name, interaction.user.discriminator), description=f"{message_content} {pinged_msg_content}", color=0x00a8ff) view = Close() await ticket_channel.send(embed=em, view=view) em3 = discord.Embed(title="TMS Tickets", description="Your ticket has been created at {}".format( ticket_channel.mention), color=0x00a8ff) await interaction.response.send_message(embed=em3, ephemeral=True) ``` ### Expected Results It to work, and it to send the message to the ticket channel then respond to the interaction ### Actual Results It responds then sends the ticket message 2 times, and throws an error saying its already been responded to. (this is a persistent view btw) ### Intents discord.Intents.all() ### System Information Python v3.9.6-final - discord.py v2.0.0-alpha - discord.py pkg_resources: v2.0.0a3637+g0637a628 - aiohttp v3.7.4.post0 ### Checklist - [x] I have searched the open issues for duplicates. - [X] I have shown the entire traceback, if possible. - [X] I have removed my token from display, if visible. ### Additional Context _No response_
Gnome-py commented 2021-10-01 11:02:38 +00:00 (Migrated from github.com)

Can you shorten your MRE to be an actual minimal example, it would help you debug this as well as us (we don't have half of these variables)

Can you shorten your MRE to be an actual minimal example, it would help you debug this as well as us (we don't have half of these variables)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: matthew/enhanced-discord.py#78
No description provided.