'Problems sending modals directly to a different channel using Discord.py 2.0
I'm having problems with the modal component in my bot, I want to make a feedback feature where members can send a text to a private channel for mods only, but when it doesn't directly respond to the user's message in the same channel (using await interaction.respond.send_message) it displays as "Interaction failed" even though the message was correctly sent to the mod channel (using bot.get_channel and channel.send). My current solution is to use delete_original_message after sending the response but I wanted a more elegant solution.
Here's the code:
async def on_submit(self, interaction: discord.Interaction):
feedback_form = discord.Embed(
title=None,
description= f"{self.feedback}\n\n",
color=3092790)
feedback_form.set_author(name = interaction.user, icon=interaction.user.avatar)
await interaction.response.send_message(embed=feedback_form)
await interaction.delete_original_message()
channel = bot.get_channel(965032417901576202)
await channel.send(embed=feedback_form)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
