Skip to main content
Module

x/discordeno/types/discordeno.ts

Discord API library for Deno
Extremely Popular
Go to Latest
File
import { SelectOption } from "../transformers/component.ts";import { AllowedMentionsTypes, ButtonStyles, MessageComponentTypes, TextStyles } from "./shared.ts";
export type MessageComponents = ActionRow[];
/** https://discord.com/developers/docs/interactions/message-components#actionrow */export interface ActionRow { /** Action rows are a group of buttons. */ type: MessageComponentTypes.ActionRow; /** The components in this row */ components: | [SelectMenuComponent | ButtonComponent | InputTextComponent] | [ButtonComponent, ButtonComponent] | [ButtonComponent, ButtonComponent, ButtonComponent] | [ButtonComponent, ButtonComponent, ButtonComponent, ButtonComponent] | [ButtonComponent, ButtonComponent, ButtonComponent, ButtonComponent, ButtonComponent];}
/** https://discord.com/developers/docs/interactions/message-components#button-object-button-structure */export interface ButtonComponent { /** All button components have type 2 */ type: MessageComponentTypes.Button; /** for what the button says (max 80 characters) */ label: string; /** a dev-defined unique string sent on click (max 100 characters). type 5 Link buttons can not have a custom_id */ customId?: string; /** For different styles/colors of the buttons */ style: ButtonStyles; /** Emoji object that includes fields of name, id, and animated supporting unicode and custom emojis. */ emoji?: { /** Emoji id */ id?: bigint; /** Emoji name */ name?: string; /** Whether this emoji is animated */ animated?: boolean; }; /** optional url for link-style buttons that can navigate a user to the web. Only type 5 Link buttons can have a url */ url?: string; /** Whether or not this button is disabled */ disabled?: boolean;}
/** https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-menu-structure */export interface SelectMenuComponent { /** SelectMenu Component is of type 3 */ type: MessageComponentTypes.SelectMenu; /** A custom identifier for this component. Maximum 100 characters. */ customId: string; /** A custom placeholder text if nothing is selected. Maximum 150 characters. */ placeholder?: string; /** The minimum number of items that must be selected. Default 1. Between 1-25. */ minValues?: number; /** The maximum number of items that can be selected. Default 1. Between 1-25. */ maxValues?: number; /** The choices! Maximum of 25 items. */ options: SelectOption[];}
/** https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-structure */export interface InputTextComponent { /** InputText Component is of type 4 */ type: MessageComponentTypes.InputText; /** The style of the InputText */ style: TextStyles; /** The customId of the InputText */ customId: string; /** The label of the InputText */ label: string; /** The placeholder of the InputText */ placeholder?: string; /** The minimum length of the text the user has to provide */ minLength?: number; /** The maximum length of the text the user has to provide */ maxLength?: number; /** Whether or not this input is required. */ required?: boolean; /** Pre-filled value for input text. */ value?: string;}
/** https://discord.com/developers/docs/resources/channel#allowed-mentions-object */export interface AllowedMentions { /** An array of allowed mention types to parse from the content. */ parse?: AllowedMentionsTypes[]; /** For replies, whether to mention the author of the message being replied to (default false) */ repliedUser?: boolean;
/** Array of role_ids to mention (Max size of 100) */ roles?: bigint[]; /** Array of user_ids to mention (Max size of 100) */ users?: bigint[];}
export interface FileContent { /** The file blob */ blob: Blob; /** The name of the file */ name: string;}
/** https://discord.com/developers/docs/resources/guild#search-guild-members-query-string-params */export interface SearchMembers { /** Query string to match username(s) and nickname(s) against */ query: string; /** Max number of members to return (1-1000). Default: 1 */ limit?: number;}