Discord-Net-Labs / Discord.Net-Labs

An experimental fork of Discord.Net that implements the newest discord features for testing and development to eventually get merged into Discord.Net
https://labs.discordnet.dev
MIT License
156 stars 42 forks source link

Withbutton method does not handle exception when using buttonbuilder #430

Closed hikaru1337 closed 2 years ago

hikaru1337 commented 2 years ago

Check The Docs

Verify Issue Source

Check your intents

Description

When using the assembled buttonbuilder manually, the method does not check the styles, as it is done if the button is assembled through the method.

If it's easier, if you assemble the button through the method, then the style is checked, if you assemble it through the button builder, the style is not checked.

Version

3.6.1 labs

Working Version

No response

Logs

image

Sample

var ButtonRight = new ButtonBuilder { Label = "testLabel", CustomId = $"TestId"};
var Comp = new ComponentBuilder().WithButton(ButtonRight);

try
{
    await Context.Channel.SendMessageAsync("", false, null, components: Comp.Build());
}
catch (Discord.Net.HttpException ex)
{
    Console.WriteLine(ex.Errors);
}
CottageDwellingCat commented 2 years ago

this is resolved in #429