#🔒 i can´t embed a local gif

8 messages · Page 1 of 1 (latest)

cerulean drum
#

I try with this code to make a embed with a gif and this isn´t working:

@bot.tree.command(name="accept", description="Verifiziert einen Nutzer")
async def accept(interaction: discord.Interaction, nutzer: discord.Member):
    await interaction.response.send_message(f"{nutzer.mention} wurde verifiziert!", ephemeral=False)

    welcome_channel = interaction.guild.get_channel(1391023927781756954)
    if welcome_channel:
        file = discord.File("willkommen.gif", filename="willkommen.gif")
        embed = discord.Embed(
            title="Willkommen!",
            description=f"Willkommen auf dem Server, {nutzer.mention}!",
            color=discord.Color.green()
        )
        embed.set_image(url="attachment://willkommen.gif")
        await welcome_channel.send(embed=embed)

    rolle_entfernen = interaction.guild.get_role(1391023926414544946)
    rolle_hinzufuegen = interaction.guild.get_role(1391437013282197655)

    if rolle_entfernen and rolle_entfernen in nutzer.roles:
        await nutzer.remove_roles(rolle_entfernen)
    if rolle_hinzufuegen:
        await nutzer.add_roles(rolle_hinzufuegen)```

and the gif is a .gif file
silk iglooBOT
#

@cerulean drum

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

fossil wing
#

You have to attach the image to the message for the attachment to be recognized

#

you should be doing await welcome_channel.send(embed=embed, file=file) I believe

cerulean drum
#

after I restarted twice it works xD that's called a feature

#

!close

silk iglooBOT
#
Python help channel closed with !close

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.