0
votes

So I am making a discord Bot which has a command to send random reddit submissions.

If the bot hit's an image everything is fine, but if it's a gif it is only displayed in the Pycharm console, not sent do discord (the poop emoji appears)

I am using praw to fetch the reddit content.

In the attached images is the command itself as well as my embed function and the output in Pycharm/Discord.

In my screenshot the image is a png and works. When it's a gif it's loading for a few seconds and shows the poop emoji, like nothing found. In Pycharm it's printing the image path.

As I've seen Bots posting them as embeds they get sent, so it seems to work..

Python code

1

1 Answers

1
votes

Hi. Discord adds all images as an attachment.

Here is what you can do:

#PS I am assuming you are writing it in command and have an embed setup.

img=<path of image>
file = discord.File(img)
embed.set_image(url="attachment://image.gif")
await ctx.send(file=file, embed=embed)