Reputation: 546
I'm creating a bot that allows users to create embedded messages. Here is a command that I am working with:
@bot.command()
async def embed(ctx,title_str,text_str,url_str):
embed=discord.Embed(title=title_str, url=url_str, description=text_str, color=0xFF5733)
await ctx.send(embed=embed)
This works fine, but if a video is linked I'd like it to add a preview image - in the same way it does if you post a Youtube link I tried adding image = video_url to the discord.Embed command, but this did not help.
Clearly discord is able to do this because when you type in a url to a video you get a preview in an embed automatically generated.
Upvotes: 2
Views: 4735
Reputation: 578
Per the Discord API docs: "For the embed object, you can set every field except type (it will be rich regardless of if you try to set it), provider, video, and any height, width, or proxy_url values for images."
Therefore, you cannot assign a video to Embeds via the API.
See: https://discord.com/developers/docs/resources/channel#create-message
Upvotes: 3