Popii - v0.5.1
    Preparing search index...

    Interface PopiiCommandDefinition<TState, TInput, TLocals>

    The full definition of a Popii command, including its metadata, options, guards, and handler.

    You don't usually interact with this interface directly — use the command builder function, which infers all types for you.

    interface PopiiCommandDefinition<
        TState = any,
        TInput = any,
        TLocals = PopiiLocals & Record<string, any>,
    > {
        name: string;
        nameLocalizations?: Partial<
            Record<
                | "id"
                | "en-US"
                | "en-GB"
                | "bg"
                | "zh-CN"
                | "zh-TW"
                | "hr"
                | "cs"
                | "da"
                | "nl"
                | "fi"
                | "fr"
                | "de"
                | "el"
                | "hi"
                | "hu"
                | "it"
                | "ja"
                | "ko"
                | "lt"
                | "no"
                | "pl"
                | "pt-BR"
                | "ro"
                | "ru"
                | "es-ES"
                | "es-419"
                | "sv-SE"
                | "th"
                | "tr"
                | "uk"
                | "vi",
                string,
            >,
        >;
        description: string;
        descriptionLocalizations?: Partial<
            Record<
                | "id"
                | "en-US"
                | "en-GB"
                | "bg"
                | "zh-CN"
                | "zh-TW"
                | "hr"
                | "cs"
                | "da"
                | "nl"
                | "fi"
                | "fr"
                | "de"
                | "el"
                | "hi"
                | "hu"
                | "it"
                | "ja"
                | "ko"
                | "lt"
                | "no"
                | "pl"
                | "pt-BR"
                | "ro"
                | "ru"
                | "es-ES"
                | "es-419"
                | "sv-SE"
                | "th"
                | "tr"
                | "uk"
                | "vi",
                string,
            >,
        >;
        type?: ApplicationCommandType;
        slash?: boolean;
        text?: boolean;
        category?: string;
        aliases?: string[];
        usage?: string;
        integrationTypes?: ApplicationIntegrationType[];
        contexts?: InteractionContextType[];
        quota?: {
            limit: number;
            timeframe: number;
            scope?: "user"
            | "guild"
            | "global";
        };
        cooldown?: | number
        | { ms: number; uses?: number; scope?: "user"
        | "guild"
        | "global" };
        guildOnly?: boolean;
        ownerOnly?: boolean;
        premium?: boolean;
        ephemeral?: boolean;
        mutex?: boolean;
        hidden?: boolean;
        permissions?: (
            | bigint
            | "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"
            | "PinMessages"
            | "BypassSlowmode"
        )[];
        allowedRoles?: string[];
        deniedRoles?: string[];
        allowedChannels?: string[];
        options?: PopiiOption<TState, any, TLocals>[];
        autocomplete?(pop: Pop<TState, TInput, TLocals>): void | Promise<void>;
        middlewares?: PopiiMiddleware<TState, TInput, TLocals>[];
        schema?: PopiiSchema<TInput>;
        deferAfter?: number;
        do(pop: Pop<TState, TInput, TLocals>): void | Promise<void>;
    }

    Type Parameters

    • TState = any
    • TInput = any
    • TLocals = PopiiLocals & Record<string, any>
    Index

    Methods

    Properties

    name: string
    nameLocalizations?: Partial<
        Record<
            | "id"
            | "en-US"
            | "en-GB"
            | "bg"
            | "zh-CN"
            | "zh-TW"
            | "hr"
            | "cs"
            | "da"
            | "nl"
            | "fi"
            | "fr"
            | "de"
            | "el"
            | "hi"
            | "hu"
            | "it"
            | "ja"
            | "ko"
            | "lt"
            | "no"
            | "pl"
            | "pt-BR"
            | "ro"
            | "ru"
            | "es-ES"
            | "es-419"
            | "sv-SE"
            | "th"
            | "tr"
            | "uk"
            | "vi",
            string,
        >,
    >
    description: string
    descriptionLocalizations?: Partial<
        Record<
            | "id"
            | "en-US"
            | "en-GB"
            | "bg"
            | "zh-CN"
            | "zh-TW"
            | "hr"
            | "cs"
            | "da"
            | "nl"
            | "fi"
            | "fr"
            | "de"
            | "el"
            | "hi"
            | "hu"
            | "it"
            | "ja"
            | "ko"
            | "lt"
            | "no"
            | "pl"
            | "pt-BR"
            | "ro"
            | "ru"
            | "es-ES"
            | "es-419"
            | "sv-SE"
            | "th"
            | "tr"
            | "uk"
            | "vi",
            string,
        >,
    >
    type?: ApplicationCommandType
    slash?: boolean
    text?: boolean
    category?: string
    aliases?: string[]
    usage?: string
    integrationTypes?: ApplicationIntegrationType[]
    contexts?: InteractionContextType[]
    quota?: {
        limit: number;
        timeframe: number;
        scope?: "user" | "guild" | "global";
    }
    cooldown?:
        | number
        | { ms: number; uses?: number; scope?: "user"
        | "guild"
        | "global" }
    guildOnly?: boolean
    ownerOnly?: boolean
    premium?: boolean
    ephemeral?: boolean
    mutex?: boolean
    hidden?: boolean
    permissions?: (
        | bigint
        | "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"
        | "PinMessages"
        | "BypassSlowmode"
    )[]
    allowedRoles?: string[]
    deniedRoles?: string[]
    allowedChannels?: string[]
    options?: PopiiOption<TState, any, TLocals>[]
    deferAfter?: number

    Override the auto-defer threshold in ms. Defaults to 2000.