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

Discord enforces the following per-application command limits server-side (as of March 2026):

  • ChatInput (slash commands): 100 global, 100 per guild
  • User commands (context menu): 15 global, 15 per guild
  • Message commands (context menu): 15 global, 15 per guild

Summary

Interaction.name  :: string

The name of the command.

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

Localization dictionary for the name field.

Interaction.description  :: string

The description of the command.

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

Localization dictionary for the description field.

Interaction.options  :: JSON }

A list of parameters/options for the command.

Interaction.defaultMemberPermissions  :: string?

Permissions required to execute the command.

Interaction.integrationTypes  :: IntegrationTypesConfig }

Installation contexts the command is available to.

Interaction.contexts  :: InteractionContextType }

Interaction contexts where the command can be used.

Interaction.nsfw  :: boolean?

Whether this command is age-restricted.

Interaction : setName ( name )  -> Interaction

Name of command, 1-32 characters

Parameters

name: string

Returns

Interaction
Interaction : setType ( commandType )  -> Interaction

Set the Type of command

Parameters

commandType: ApplicationCommandType

Returns

Interaction
Interaction : setNameLocalization ( localization name )  -> Interaction

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

Parameters

localization: LanguageLocales
name: string

Returns

Interaction
Interaction : setDescription ( description )  -> Interaction

1-100 character description

Parameters

description: string

Returns

Interaction
Interaction : setDescriptionLocalization ( localization description )  -> Interaction

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

Parameters

localization: LanguageLocales
description: string

Returns

Interaction
Interaction : addOption ( option )  -> Interaction

The parameters for the command

Parameters

option: JSON

Returns

Interaction
Interaction : setDefaultMemberPermissions ( permissions )  -> Interaction

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

Parameters

permissions: string

Returns

Interaction
Interaction : addIntegrationType ( type )  -> Interaction

Installation context(s) where the command is available

Parameters

type: IntegrationTypesConfig

Returns

Interaction
Interaction : addContext ( context )  -> Interaction

Interaction context(s) where the command can be used

Parameters

context: InteractionContextType

Returns

Interaction
Interaction : setNsfw ( isNsfw )  -> Interaction

Indicates whether the command is age-restricted

Parameters

isNsfw: boolean

Returns

Interaction
Interaction : build ( )  -> JSON

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

Returns

JSON
Interaction . new ( resource )  -> Interaction

Constructor for the Discord Default Reaction Builder.

Parameters

resource: {
name: string?,
nameLocalizations: { [apiTypes.LanguageLocales],
}

Returns

Interaction