mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-21 02:40:08 +00:00
Implement missing isModalSubmitInteraction typeguard in deno types
Added a type-guard function to check for modal submit interactions in deno types because I missed that before.
This commit is contained in:
15
deno/utils/v10.ts
generated
15
deno/utils/v10.ts
generated
@@ -15,6 +15,7 @@ import type {
|
||||
APIMessageComponentGuildInteraction,
|
||||
APIMessageComponentInteraction,
|
||||
APIMessageComponentSelectMenuInteraction,
|
||||
APIModalSubmitInteraction,
|
||||
} from '../payloads/v10/mod.ts';
|
||||
import { ApplicationCommandType, ButtonStyle, ComponentType, InteractionType } from '../payloads/v10/mod.ts';
|
||||
|
||||
@@ -114,6 +115,20 @@ export function isInteractionButton(component: APIButtonComponent): component is
|
||||
return ![ButtonStyle.Link, ButtonStyle.Premium].includes(component.style);
|
||||
}
|
||||
|
||||
// Modal
|
||||
|
||||
/**
|
||||
* A type-guard check for modals submit interactions
|
||||
*
|
||||
* @param interaction - The interaction to check against
|
||||
* @returns A boolean that indicates if the interaction is a modal submission
|
||||
*/
|
||||
export function isModalSubmitInteraction(
|
||||
interaction: APIInteraction,
|
||||
): interaction is APIModalSubmitInteraction {
|
||||
return interaction.type === InteractionType.ModalSubmit;
|
||||
}
|
||||
|
||||
// Message Components
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user