'I am having trouble setting a GIF in an embed in discord.py
I currently have a list of gifs in a list in a different python file(I don't know how to use json) and I have for an embed embed.set_image(url=random.choice(gifs.gifs)
(gifs being the python file and list). When this happens, you can see the outline of an image but it is blank. How may I resolve this?
Solution 1:[1]
Seems like everything works for me. You can try using my code. But if it doesn't work either could you send your code to review it?
Gif Command:
@bot.command("gif")
async def send_gif(ctx: commands.Context):
import gifs
embed = Embed()
embed.set_image(url=random.choice(gifs.gifs))
await ctx.send(embed=embed)
Gifs.py File:
gifs = [
"https://media1.giphy.com/media/25oFarLxPqrNS/giphy.gif?cid=ecf05e47x28vl8dmq3zcn3471yorivulan62t8hbpdzg0q7f&rid=giphy.gif&ct=g",
"https://media1.giphy.com/media/hpW93QfcSkzHa/giphy.gif?cid=ecf05e47x28vl8dmq3zcn3471yorivulan62t8hbpdzg0q7f&rid=giphy.gif&ct=g"
]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Koll |