Skip to content

Commit 736479c

Browse files
authored
fix(isInteractionButton): handle ButtonStyle.Premium (#1135)
1 parent d673e5f commit 736479c

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

deno/utils/v10.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function isLinkButton(component: APIButtonComponent): component is APIBut
111111
* @returns A boolean that indicates if the button has a `custom_id` attached to it
112112
*/
113113
export function isInteractionButton(component: APIButtonComponent): component is APIButtonComponentWithCustomId {
114-
return component.style !== ButtonStyle.Link;
114+
return ![ButtonStyle.Link, ButtonStyle.Premium].includes(component.style);
115115
}
116116

117117
// Message Components

deno/utils/v9.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function isLinkButton(component: APIButtonComponent): component is APIBut
111111
* @returns A boolean that indicates if the button has a `custom_id` attached to it
112112
*/
113113
export function isInteractionButton(component: APIButtonComponent): component is APIButtonComponentWithCustomId {
114-
return component.style !== ButtonStyle.Link;
114+
return ![ButtonStyle.Link, ButtonStyle.Premium].includes(component.style);
115115
}
116116

117117
// Message Components

utils/v10.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function isLinkButton(component: APIButtonComponent): component is APIBut
111111
* @returns A boolean that indicates if the button has a `custom_id` attached to it
112112
*/
113113
export function isInteractionButton(component: APIButtonComponent): component is APIButtonComponentWithCustomId {
114-
return component.style !== ButtonStyle.Link;
114+
return ![ButtonStyle.Link, ButtonStyle.Premium].includes(component.style);
115115
}
116116

117117
// Message Components

utils/v9.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function isLinkButton(component: APIButtonComponent): component is APIBut
111111
* @returns A boolean that indicates if the button has a `custom_id` attached to it
112112
*/
113113
export function isInteractionButton(component: APIButtonComponent): component is APIButtonComponentWithCustomId {
114-
return component.style !== ButtonStyle.Link;
114+
return ![ButtonStyle.Link, ButtonStyle.Premium].includes(component.style);
115115
}
116116

117117
// Message Components

0 commit comments

Comments
 (0)