OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

discord.py send an embed in a specific channel with a slash command

  • Thread starter Thread starter Side Heat
  • Start date Start date
S

Side Heat

Guest
I was searching for how to send a message on a chosen channel with a slash command, but I didn't find a way to realize this project, and maybe help me with the color too. Here is a part of my code:

Code:
@bot.tree.command(guild= discord.Object(id=1127167530184740954), name="embed", description="Create an embed!")
async def cr_embed(interaction: discord.Interaction, title: str, description: str, colour_: int, field: str, value: str, channel_: discord.app_commands.AllChannels):
    cr_embed = discord.Embed(title=title, description=description, colour=couleur)
    cr_embed.add_field(name=field, value=value, inline=False)
    await salon.send(embeds=[cr_embed], ephemeral=False)

If someone can help me about this that would be very helpful!
<p>I was searching for how to send a message on a chosen channel with a slash command, but I didn't find a way to realize this project, and maybe help me with the color too. Here is a part of my code:</p>
<pre><code>@bot.tree.command(guild= discord.Object(id=1127167530184740954), name="embed", description="Create an embed!")
async def cr_embed(interaction: discord.Interaction, title: str, description: str, colour_: int, field: str, value: str, channel_: discord.app_commands.AllChannels):
cr_embed = discord.Embed(title=title, description=description, colour=couleur)
cr_embed.add_field(name=field, value=value, inline=False)
await salon.send(embeds=[cr_embed], ephemeral=False)
</code></pre>
<p>If someone can help me about this that would be very helpful!</p>
 

Latest posts

Top