Enforce valid button styles (#2157)

Co-authored-by: CottageDwellingCat <80918250+CottageDwellingCat@users.noreply.github.com>
This commit is contained in:
Quin Lynch
2022-03-02 19:24:00 -04:00
committed by GitHub
parent c80067425a
commit 507a18d389

View File

@@ -613,6 +613,9 @@ namespace Discord
if (!(string.IsNullOrEmpty(Url) ^ string.IsNullOrEmpty(CustomId)))
throw new InvalidOperationException("A button must contain either a URL or a CustomId, but not both!");
if (Style == 0)
throw new ArgumentException("A button must have a style.", nameof(Style));
if (Style == ButtonStyle.Link)
{
if (string.IsNullOrEmpty(Url))