From 736479cab3332f6be122965963d37c8d4c99fc7f Mon Sep 17 00:00:00 2001 From: Danial Raza Date: Tue, 5 Nov 2024 22:36:46 +0100 Subject: [PATCH] fix(isInteractionButton): handle `ButtonStyle.Premium` (#1135) --- deno/utils/v10.ts | 2 +- deno/utils/v9.ts | 2 +- utils/v10.ts | 2 +- utils/v9.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deno/utils/v10.ts b/deno/utils/v10.ts index bf08c519..e6df7037 100644 --- a/deno/utils/v10.ts +++ b/deno/utils/v10.ts @@ -111,7 +111,7 @@ export function isLinkButton(component: APIButtonComponent): component is APIBut * @returns A boolean that indicates if the button has a `custom_id` attached to it */ export function isInteractionButton(component: APIButtonComponent): component is APIButtonComponentWithCustomId { - return component.style !== ButtonStyle.Link; + return ![ButtonStyle.Link, ButtonStyle.Premium].includes(component.style); } // Message Components diff --git a/deno/utils/v9.ts b/deno/utils/v9.ts index c791f2fd..8384fb28 100644 --- a/deno/utils/v9.ts +++ b/deno/utils/v9.ts @@ -111,7 +111,7 @@ export function isLinkButton(component: APIButtonComponent): component is APIBut * @returns A boolean that indicates if the button has a `custom_id` attached to it */ export function isInteractionButton(component: APIButtonComponent): component is APIButtonComponentWithCustomId { - return component.style !== ButtonStyle.Link; + return ![ButtonStyle.Link, ButtonStyle.Premium].includes(component.style); } // Message Components diff --git a/utils/v10.ts b/utils/v10.ts index bf990bf2..7da98a4b 100644 --- a/utils/v10.ts +++ b/utils/v10.ts @@ -111,7 +111,7 @@ export function isLinkButton(component: APIButtonComponent): component is APIBut * @returns A boolean that indicates if the button has a `custom_id` attached to it */ export function isInteractionButton(component: APIButtonComponent): component is APIButtonComponentWithCustomId { - return component.style !== ButtonStyle.Link; + return ![ButtonStyle.Link, ButtonStyle.Premium].includes(component.style); } // Message Components diff --git a/utils/v9.ts b/utils/v9.ts index 80580f42..32d4106f 100644 --- a/utils/v9.ts +++ b/utils/v9.ts @@ -111,7 +111,7 @@ export function isLinkButton(component: APIButtonComponent): component is APIBut * @returns A boolean that indicates if the button has a `custom_id` attached to it */ export function isInteractionButton(component: APIButtonComponent): component is APIButtonComponentWithCustomId { - return component.style !== ButtonStyle.Link; + return ![ButtonStyle.Link, ButtonStyle.Premium].includes(component.style); } // Message Components