Discord.https - v3.0.16
    Preparing search index...

    Class ContextMenuCommandBuilder

    A builder that creates API-compatible JSON data for context menu commands.

    Index

    Constructors

    Properties

    The contexts for this command.

    default_member_permissions: undefined | null | string

    The set of permissions represented as a bit set for the command.

    default_permission: undefined | boolean

    Whether this command is enabled by default when the application is added to a guild.

    dm_permission: undefined | boolean

    Indicates whether the command is available in direct messages with the application.

    By default, commands are visible. This property is only for global commands.

    Use ContextMenuCommandBuilder.contexts instead.

    integration_types?: ApplicationIntegrationType[]

    The integration types for this command.

    name: string

    The name of this command.

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

    The name localizations of this command.

    The type of this command.

    Methods

    • Sets the default permissions a member should have in order to run this command.

      Parameters

      • permissions: undefined | null | string | number | bigint

        The permissions bit field to set

      Returns this

      You can set this to '0' to disable the command by default.

    • Sets the name of this command.

      Parameters

      • name: string

        The name to use

      Returns this

    • Sets a name localization for this command.

      Parameters

      • locale:
            | "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"

        The locale to set

      • localizedName: null | string

        The localized name for the given locale

      Returns this

    • Sets the name localizations for this command.

      Parameters

      • localizedNames: null | Partial<Record<Locale, null | string>>

        The object of localized names to set

      Returns this