Check The Docs
Verify Issue Source
Check your intents
Description
IUserMessage.ModifyAsync, IDiscordInteraction.ModifyOriginalResponseAsync and IComponentInteraction.UpdateAsync throw an exception when the Flags property is set to MessageFlags.None.
This only occurs when modifying a message containing components V2, and I assume this is a bug because it doesn't happen when I pass attachments.
Version
3.18.0-nightly.20250516.531
Working Version
No response
Logs
Discord.Net.HttpException: The server responded with error 50035: Invalid Form Body
Inner Errors:
UNION_TYPE_CHOICES: Value of field "type" must be one of (1,).
at Discord.Net.Queue.RequestBucket.SendAsync(RestRequest request)
at Discord.Net.Queue.RequestQueue.SendAsync(RestRequest request)
at Discord.API.DiscordRestApiClient.SendInternalAsync(String method, String endpoint, RestRequest request)
at Discord.API.DiscordRestApiClient.SendJsonAsync[TResponse](String method, String endpoint, Object payload, BucketId bucketId, ClientBucketType clientBucket, RequestOptions options)
at Discord.WebSocket.SocketInteraction.ModifyOriginalResponseAsync(Action`1 func, RequestOptions options)
at Discord.WebSocket.SocketInteraction.Discord.IDiscordInteraction.ModifyOriginalResponseAsync(Action`1 func, RequestOptions options)
at ExampleBot.Modules.PaginatorModule.ComponentAsync(String query) in C:\Users\d4n\source\repos\d4n3436\Fergun.Interactive\ExampleBot\Modules\PaginatorModule.cs:line 148
at Discord.Interactions.Builders.ModuleClassBuilder.<>c__DisplayClass11_0.<<CreateCallback>g__ExecuteCallback|1>d.MoveNext()
--- End of inner exception stack trace ---
Sample
var components = new ComponentBuilderV2()
.WithContainer(new ContainerBuilder()
.WithTextDisplay("Test")
.WithAccentColor(Color.Blue))
.Build();
await Context.Interaction.RespondAsync(components: components);
var newComponents = new ComponentBuilderV2()
.WithContainer(new ContainerBuilder()
.WithTextDisplay("Modified")
.WithAccentColor(Color.Blue))
.Build();
await Context.Interaction.ModifyOriginalResponseAsync(x => // Throws exception
{
x.Flags = MessageFlags.None;
x.Components = newComponents;
});
Packages
(None)
Environment
OS: Windows 11
SDK: .NET 8
Check The Docs
Verify Issue Source
Check your intents
Description
IUserMessage.ModifyAsync,IDiscordInteraction.ModifyOriginalResponseAsyncandIComponentInteraction.UpdateAsyncthrow an exception when theFlagsproperty is set toMessageFlags.None.This only occurs when modifying a message containing components V2, and I assume this is a bug because it doesn't happen when I pass attachments.
Version
3.18.0-nightly.20250516.531
Working Version
No response
Logs
Sample
Packages
(None)
Environment
OS: Windows 11
SDK: .NET 8