Class AresChatInputCommandBuilder

Hierarchy

Constructors

Properties

type: ApplicationCommandType = ApplicationCommandType.ChatInput
isDisabled: boolean = true
name: string

The name of this command.

name_localizations?: 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", null | string>>

The name localizations of this command.

description: string

The description of this command.

description_localizations?: 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", null | string>>

The description localizations of this command.

options: ToAPIApplicationCommandOptions[]

The options of this command.

contexts?: InteractionContextType[]

The contexts for this command.

default_permission: undefined | boolean

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

Deprecated

Use SharedSlashCommand.setDefaultMemberPermissions or SharedSlashCommand.setDMPermission instead.

default_member_permissions: undefined | null | string

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

dm_permission: undefined | boolean

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

Remarks

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

Deprecated

Use SlashCommandBuilder.contexts instead.

integration_types?: ApplicationIntegrationType[]

The integration types for this command.

nsfw: undefined | boolean

Whether this command is NSFW.

Methods

  • Sets the name of this command.

    Parameters

    • name: string

      The name to use

    Returns AresChatInputCommandBuilder

  • Sets the description of this command.

    Parameters

    • description: string

      The description to use

    Returns AresChatInputCommandBuilder

  • 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 AresChatInputCommandBuilder

  • Sets the name localizations for this command.

    Parameters

    • localizedNames: null | 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", null | string>>

      The object of localized names to set

    Returns AresChatInputCommandBuilder

  • Sets a description 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

    • localizedDescription: null | string

      The localized description for the given locale

    Returns AresChatInputCommandBuilder

  • Sets the description localizations for this command.

    Parameters

    • localizedDescriptions: null | 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", null | string>>

      The object of localized descriptions to set

    Returns AresChatInputCommandBuilder

  • Adds a boolean option.

    Parameters

    • input: SlashCommandBooleanOption | ((builder) => SlashCommandBooleanOption)

      A function that returns an option builder or an already built builder

    Returns SlashCommandOptionsOnlyBuilder

  • Adds a user option.

    Parameters

    • input: SlashCommandUserOption | ((builder) => SlashCommandUserOption)

      A function that returns an option builder or an already built builder

    Returns SlashCommandOptionsOnlyBuilder

  • Adds a channel option.

    Parameters

    • input: SlashCommandChannelOption | ((builder) => SlashCommandChannelOption)

      A function that returns an option builder or an already built builder

    Returns SlashCommandOptionsOnlyBuilder

  • Adds a role option.

    Parameters

    • input: SlashCommandRoleOption | ((builder) => SlashCommandRoleOption)

      A function that returns an option builder or an already built builder

    Returns SlashCommandOptionsOnlyBuilder

  • Adds an attachment option.

    Parameters

    • input: SlashCommandAttachmentOption | ((builder) => SlashCommandAttachmentOption)

      A function that returns an option builder or an already built builder

    Returns SlashCommandOptionsOnlyBuilder

  • Adds a mentionable option.

    Parameters

    • input: SlashCommandMentionableOption | ((builder) => SlashCommandMentionableOption)

      A function that returns an option builder or an already built builder

    Returns SlashCommandOptionsOnlyBuilder

  • Adds a string option.

    Parameters

    • input: SlashCommandStringOption | ((builder) => SlashCommandStringOption)

      A function that returns an option builder or an already built builder

    Returns SlashCommandOptionsOnlyBuilder

  • Adds an integer option.

    Parameters

    • input: SlashCommandIntegerOption | ((builder) => SlashCommandIntegerOption)

      A function that returns an option builder or an already built builder

    Returns SlashCommandOptionsOnlyBuilder

  • Adds a number option.

    Parameters

    • input: SlashCommandNumberOption | ((builder) => SlashCommandNumberOption)

      A function that returns an option builder or an already built builder

    Returns SlashCommandOptionsOnlyBuilder

  • Adds a new subcommand group to this command.

    Parameters

    • input: SlashCommandSubcommandGroupBuilder | ((subcommandGroup) => SlashCommandSubcommandGroupBuilder)

      A function that returns a subcommand group builder or an already built builder

    Returns SlashCommandSubcommandsOnlyBuilder

  • Adds a new subcommand to this command.

    Parameters

    • input: SlashCommandSubcommandBuilder | ((subcommandGroup) => SlashCommandSubcommandBuilder)

      A function that returns a subcommand builder or an already built builder

    Returns SlashCommandSubcommandsOnlyBuilder

  • Sets the contexts of this command.

    Parameters

    • Rest ...contexts: RestOrArray<InteractionContextType>

      The contexts

    Returns AresChatInputCommandBuilder

  • Sets the integration types of this command.

    Parameters

    • Rest ...integrationTypes: RestOrArray<ApplicationIntegrationType>

      The integration types

    Returns AresChatInputCommandBuilder

  • Sets whether the command is enabled by default when the application is added to a guild.

    Parameters

    • value: boolean

      Whether or not to enable this command by default

    Returns AresChatInputCommandBuilder

    Remarks

    If set to false, you will have to later PUT the permissions for this command.

    See

    https://discord.com/developers/docs/interactions/application-commands#permissions

    Deprecated

    Use SharedSlashCommand.setDefaultMemberPermissions or SharedSlashCommand.setDMPermission instead.

  • Sets whether this command is NSFW.

    Parameters

    • Optional nsfw: boolean

      Whether this command is NSFW

    Returns AresChatInputCommandBuilder

  • Serializes this builder to API-compatible JSON data.

    Returns RESTPostAPIChatInputApplicationCommandsJSONBody

    Remarks

    This method runs validations on the data before serializing it. As such, it may throw an error if the data is invalid.

Generated using TypeDoc