interface Command {
    context?: InteractionContextType;
    description?: string;
    description_localizations?: Partial<Record<Locale, null | string>>;
    name: string;
    name_localizations?: Partial<Record<Locale, null | string>>;
    nsfw?: boolean;
    options?: Option[];
    permisions?: (
        | "CreateInstantInvite"
        | "KickMembers"
        | "BanMembers"
        | "Administrator"
        | "ManageChannels"
        | "ManageGuild"
        | "AddReactions"
        | "ViewAuditLog"
        | "PrioritySpeaker"
        | "Stream"
        | "ViewChannel"
        | "SendMessages"
        | "SendTTSMessages"
        | "ManageMessages"
        | "EmbedLinks"
        | "AttachFiles"
        | "ReadMessageHistory"
        | "MentionEveryone"
        | "UseExternalEmojis"
        | "ViewGuildInsights"
        | "Connect"
        | "Speak"
        | "MuteMembers"
        | "DeafenMembers"
        | "MoveMembers"
        | "UseVAD"
        | "ChangeNickname"
        | "ManageNicknames"
        | "ManageRoles"
        | "ManageWebhooks"
        | "ManageEmojisAndStickers"
        | "ManageGuildExpressions"
        | "UseApplicationCommands"
        | "RequestToSpeak"
        | "ManageEvents"
        | "ManageThreads"
        | "CreatePublicThreads"
        | "CreatePrivateThreads"
        | "UseExternalStickers"
        | "SendMessagesInThreads"
        | "UseEmbeddedActivities"
        | "ModerateMembers"
        | "ViewCreatorMonetizationAnalytics"
        | "UseSoundboard"
        | "CreateGuildExpressions"
        | "CreateEvents"
        | "UseExternalSounds"
        | "SendVoiceMessages"
        | "SendPolls"
        | "UseExternalApps"
    )[];
    subcommandgroups?: Subcommandgroup[];
    subcommands?: Subcommand[];
}

Hierarchy (View Summary)

Properties

context?: InteractionContextType

The context in which the command can be used. If not specified, the command can be used in both guild and DM contexts.

description?: string

The description of the command, subcommand, subcommand group. Required if it's an option. This should be a string that describes what the command does. It can be localized using the description_localizations property.

description_localizations?: Partial<Record<Locale, null | string>>

The localizations for the command description. This should be an object where the keys are locale codes and the values are the localized descriptions.

{ "en-US": "This is my command" }
name: string

The name of the command, subcommand, subcommand group, option. This should be a lowercase string with no spaces. It can only contain alphanumeric characters, underscores, and dashes.

name_localizations?: Partial<Record<Locale, null | string>>

The localizations for the command name. This should be an object where the keys are locale codes and the values are the localized names.

{ "en-US": "My Command" }
nsfw?: boolean

Whether the command is NSFW (Not Safe For Work). If true, the command can only be used in NSFW channels.

options?: Option[]

The options of the command. If specified, this command will be a simple command with options. It specified you can't have subcommands or subcommand groups.

permisions?: (
    | "CreateInstantInvite"
    | "KickMembers"
    | "BanMembers"
    | "Administrator"
    | "ManageChannels"
    | "ManageGuild"
    | "AddReactions"
    | "ViewAuditLog"
    | "PrioritySpeaker"
    | "Stream"
    | "ViewChannel"
    | "SendMessages"
    | "SendTTSMessages"
    | "ManageMessages"
    | "EmbedLinks"
    | "AttachFiles"
    | "ReadMessageHistory"
    | "MentionEveryone"
    | "UseExternalEmojis"
    | "ViewGuildInsights"
    | "Connect"
    | "Speak"
    | "MuteMembers"
    | "DeafenMembers"
    | "MoveMembers"
    | "UseVAD"
    | "ChangeNickname"
    | "ManageNicknames"
    | "ManageRoles"
    | "ManageWebhooks"
    | "ManageEmojisAndStickers"
    | "ManageGuildExpressions"
    | "UseApplicationCommands"
    | "RequestToSpeak"
    | "ManageEvents"
    | "ManageThreads"
    | "CreatePublicThreads"
    | "CreatePrivateThreads"
    | "UseExternalStickers"
    | "SendMessagesInThreads"
    | "UseEmbeddedActivities"
    | "ModerateMembers"
    | "ViewCreatorMonetizationAnalytics"
    | "UseSoundboard"
    | "CreateGuildExpressions"
    | "CreateEvents"
    | "UseExternalSounds"
    | "SendVoiceMessages"
    | "SendPolls"
    | "UseExternalApps"
)[]

The permissions required to use the command. This should be an array of permission flags from PermissionFlagsBits.

subcommandgroups?: Subcommandgroup[]

The subcommand groups of the command. If specified, this command will be a subcommand group command. It specified you can't have subcommands or options.

subcommands?: Subcommand[]

The subcommands of the command. If specified, this command will be a subcommand command. It specified you can't have subcommand groups or options.