Skip to content

Interaction

Implementation of a discord Interaction object as a luau builder.

https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command-json-params

Properties

name

Interaction.name  :: string

The name of the command.

nameLocalizations

Interaction.nameLocalizations  :: {
      {… [package].LanguageLocales: string …}    }

Localization dictionary for the name field.

description

Interaction.description  :: string

The description of the command.

descriptionLocalizations

Interaction.descriptionLocalizations  :: {
      {… [package].LanguageLocales: string …}    }

Localization dictionary for the description field.

options

Interaction.options  :: { package.option.JSON }

A list of parameters/options for the command.

defaultMemberPermissions

Interaction.defaultMemberPermissions  :: string?

Permissions required to execute the command.

integrationTypes

Interaction.integrationTypes  :: { package.api_types.IntegrationTypesConfig }

Installation contexts the command is available to.

contexts


Interaction contexts where the command can be used.

nsfw

Interaction.nsfw  :: boolean?

Whether this command is age-restricted.

Methods

The Interaction instance has no set methods!

Functions

setName

Interaction . setName (

     self: Interaction
     name: string
)  -> ()

Name of command, 1-32 characters

setType

Interaction . setType (

     self: Interaction
     commandType: apiTypes.ApplicationCommandType
)  -> ()

Set the Type of command

setNameLocalization

Interaction . setNameLocalization (

     self: Interaction
     localization: apiTypes.LanguageLocales
     name: string
)  -> ()

Localization dictionary for the name field. Values follow the same restrictions as name

setDescription

Interaction . setDescription (

     self: Interaction
     description: string
)  -> ()

1-100 character description

setDescriptionLocalization

Interaction . setDescriptionLocalization (

     self: Interaction
     localization: apiTypes.LanguageLocales
     description: string
)  -> ()

Localization dictionary for the description field. Values follow the same restrictions as description

addOption

Interaction . addOption (

     self: Interaction
     option: interactionOption.JSON
)  -> ()

The parameters for the command

setDefaultMemberPermissions

Interaction . setDefaultMemberPermissions (

     self: Interaction
     permissions: string
)  -> ()

Set of permissions represented as a bit set, recommended that you use the permission builder.

addIntegrationType

Interaction . addIntegrationType (

     self: Interaction
     type: apiTypes.IntegrationTypesConfig
)  -> ()

Installation context(s) where the command is available

addContext

Interaction . addContext (

     self: Interaction
     context: apiTypes.InteractionContextType
)  -> ()

Interaction context(s) where the command can be used

setNsfw

Interaction . setNsfw (

     self: Interaction
     isNsfw: boolean
)  -> ()

Indicates whether the command is age-restricted

build

Interaction . build (

     self: Interaction
)  -> ()

Responsible for building the default reaction object that the Discord API can understand.

new

Interaction . new (

     resource: {
       name: string?,
       nameLocalizations: { [apiTypes.LanguageLocales],
    }
)  -> ()

Constructor for the Discord Default Reaction Builder.