-
-
Notifications
You must be signed in to change notification settings - Fork 319
Closed
Description
Make sure you familiarize yourself with our contributing guidelines.
Summary
When using
interactionEvent.Interaction.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource)
and then trying to edit via the webookBuilder and adding mentions, I get the error:
Bad request 400
Inner exception:
"{\r\n "allowed_mentions": {\r\n "_errors": [\r\n {\r\n "code": "MODEL_TYPE_CONVERT",\r\n "message": "Only dictionaries may be used in a ModelType"\r\n }\r\n ]\r\n }\r\n}"
Details
Environment: VS2022
Framework: .NET 4.7.2
DSharpPlus Version: 4.3.0-nightly-01143
OS: Windows 11
- Create a message with a button to interact
- Create a method inteeracting with the button and use:
interactionEvent.Interaction.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource) - Then create a WeebHookBuilder and add a RoleMention + some content to respond.
try
{
interactionEvent.Interaction.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource).Wait();
Thred.Sleep(10000); //some operation happening
DiscordWebhookBuilder webhook = new DiscordWebhookBuilder();
DiscordRole role = interactionEvent.Interaction.Guild.GetRole(YOURROLEID);
webhook.AddMention(new RoleMention(role));
webhook.WithContent("Hello its me");
interactionEvent.Interaction.EditOriginalResponseAsync(webhook).Wait();
}
catch (Exception ex)
{
console.writelIne(ex.toString());
}
Steps to reproduce
- Click the button you created
- Wait for the error
Reactions are currently unavailable