You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I double checked the docs and couldn't find any useful information.
Verify Issue Source
I verified the issue was caused by Discord.Net.
Check your intents
I double checked that I have the required intents.
Description
When an embed has image attached and you try to modify the embed, it will cause the image to be attached to regular message outside of the embed alongside the image within the embed itself. You can get around this by nullifying the attachment as part of the ModifyAsync however this will cause the image within the embed to become a deadlink after a period of time as discord will delete the image off its server.
Version
3.5.0
Working Version
No response
Logs
N/A
Sample
// Create the original message and attach an image to the embed
var embed = new EmbedBuilder()
.WithTitle("Test")
.WithDescription("Description")
.WithImageUrl($"attachment://{fileName}")
.WithColor(Color.LightGrey);
await Context.Channel.SendFileAsync(stream, fileName, embed: embed.Build())
// Modify the message by grabbing the embed and generate a embedbuilder
var message = Context.Interaction as SocketMessageComponent;
var embed = message.Message.Embeds.First().ToEmbedBuilder();
// Simply edit the description, you don't even need to modify ImageUrl
embed.WithDescription("New description");
await message.Message.ModifyAsync(x =>
{
// Uncommenting the line below will prevent the image being duplicated but will kill the link to image after couple of mins
// x.Attachments = new Optional<IEnumerable<FileAttachment>(Enumerable.Empty<FileAttachment>());
x.Embed = embed.Build()
});
Packages
N/A
The text was updated successfully, but these errors were encountered:
Check The Docs
Verify Issue Source
Check your intents
Description
When an embed has image attached and you try to modify the embed, it will cause the image to be attached to regular message outside of the embed alongside the image within the embed itself. You can get around this by nullifying the attachment as part of the
ModifyAsync
however this will cause the image within the embed to become a deadlink after a period of time as discord will delete the image off its server.Version
3.5.0
Working Version
No response
Logs
N/A
Sample
Packages
N/A
The text was updated successfully, but these errors were encountered: