Visitar URL original
adds a way to remove embeds from a message builder by akiraveliara · Pull Request #1742 · DSharpPlus/DSharpPlus · GitHub
Skip to content

adds a way to remove embeds from a message builder - #1742

Merged
Plerx2493 merged 3 commits into
masterfrom
remove-embeds
Feb 4, 2024
Merged

Plerx2493 merged 3 commits into
masterfrom
remove-embeds

Conversation

@akiraveliara

Copy link
Copy Markdown
Member

this was pointed out in support, https://canary.discord.com/channels/379378609942560770/1094835363475886163/1203648524177113098

Remove(int index) and Remove(int start, int count) might be useful too, but those are easy enough to accomplish with something like the following and i'm not sure whether they're common enough to warrant inclusion in DSharpPlus proper

List<DiscordEmbed> temp = [.. builder.Embeds];
builder.ClearEmbeds();

// operate on temp
builder.AddEmbeds(temp);

i also took the liberty to fix nullability warnings and improve some pieces of code. i also broke MessageFlags.SupressNotifications, fixing the spelling error (the enum should also be renamed, but i'll do that when giving messages a general makeover unless we want to do it here)

@Plerx2493

Copy link
Copy Markdown
Member

Feel free to add the RemoveEmbed() stuff

@Plerx2493
Plerx2493 merged commit 9566300 into master Feb 4, 2024
@Plerx2493
Plerx2493 deleted the remove-embeds branch February 4, 2024 12:38
OoLunar pushed a commit that referenced this pull request Oct 3, 2024
* fix the base message builder up

* add a method to clear embeds

* add removeembeds methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants