Interaction
Implementation of a discord Interaction object as a luau builder.
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
Properties
Interaction.name :: stringInteraction.nameLocalizations :: { [package].LanguageLocales: string }Interaction.description :: stringInteraction.descriptionLocalizations :: { [package].LanguageLocales: string }Interaction.options :: { package.option.JSON }Interaction.defaultMemberPermissions :: string?Interaction.integrationTypes :: { package.api_types.IntegrationTypesConfig }Interaction.contexts :: { package.api_types.InteractionContextType }Interaction.nsfw :: boolean?Methods
Interaction:setName(name: string) → InteractionInteraction:setType(commandType: apiTypes.ApplicationCommandType) → InteractionInteraction:setNameLocalization(localization: apiTypes.LanguageLocales, name: string) → InteractionInteraction:setDescription(description: string) → InteractionInteraction:setDescriptionLocalization(localization: apiTypes.LanguageLocales, description: string) → InteractionInteraction:addOption(option: interactionOption.JSON) → InteractionInteraction:setDefaultMemberPermissions(permissions: string) → InteractionInteraction:addIntegrationType(type: apiTypes.IntegrationTypesConfig) → InteractionInteraction:addContext(context: apiTypes.InteractionContextType) → InteractionInteraction:setNsfw(isNsfw: boolean) → InteractionInteraction:build() → JSONProperties
Section titled “Properties”The name of the command.
nameLocalizations
Section titled “nameLocalizations”{ [package].LanguageLocales: string } }
Localization dictionary for the name field.
description
Section titled “description”The description of the command.
descriptionLocalizations
Section titled “descriptionLocalizations”{ [package].LanguageLocales: string } }
Localization dictionary for the description field.
options
Section titled “options”A list of parameters/options for the command.
defaultMemberPermissions
Section titled “defaultMemberPermissions”Permissions required to execute the command.
integrationTypes
Section titled “integrationTypes”Installation contexts the command is available to.
contexts
Section titled “contexts”Interaction contexts where the command can be used.
Whether this command is age-restricted.
Methods
Section titled “Methods”setName
Section titled “setName”Interaction : setName ( name ) -> Interaction
Name of command, 1-32 characters
Parameters
| name: string |
Returns
| Interaction |
setType
Section titled “setType”Interaction : setType ( commandType ) -> Interaction
Set the Type of command
Parameters
| commandType: ApplicationCommandType |
Returns
| Interaction |
setNameLocalization
Section titled “setNameLocalization”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 |
setDescription
Section titled “setDescription”Interaction : setDescription ( description ) -> Interaction
1-100 character description
Parameters
| description: string |
Returns
| Interaction |
setDescriptionLocalization
Section titled “setDescriptionLocalization”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 |
addOption
Section titled “addOption”Interaction : addOption ( option ) -> Interaction
The parameters for the command
Parameters
| option: JSON |
Returns
| Interaction |
setDefaultMemberPermissions
Section titled “setDefaultMemberPermissions”Interaction : setDefaultMemberPermissions ( permissions ) -> Interaction
Set of permissions represented as a bit set, recommended that you use the permission builder.
Parameters
| permissions: string |
Returns
| Interaction |
addIntegrationType
Section titled “addIntegrationType”Interaction : addIntegrationType ( type ) -> Interaction
Installation context(s) where the command is available
Parameters
| type: IntegrationTypesConfig |
Returns
| Interaction |
addContext
Section titled “addContext”Interaction : addContext ( context ) -> Interaction
Interaction context(s) where the command can be used
Parameters
| context: InteractionContextType |
Returns
| Interaction |
setNsfw
Section titled “setNsfw”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 |
Functions
Section titled “Functions”Interaction . new ( resource ) -> Interaction
Constructor for the Discord Default Reaction Builder.
Parameters
| resource: { name: string?, nameLocalizations: { [apiTypes.LanguageLocales], } |
Returns
| Interaction |