@discord-types/builders/interaction/interaction
API reference for @discord-types/builders/interaction/interaction
@discord-types/builders/interaction/interaction
Types
Interaction
Raw Type
type Interaction = Interaction.Prototype, & {
name: string,
nameLocalizations: {
[apiTypes.LanguageLocales]: string
},
description: string,
descriptionLocalizations: {
[apiTypes.LanguageLocales]: string
},
options: {interactionOption.JSON},
defaultMemberPermissions: string?,
integrationTypes: {applicationTypes.IntegrationTypesConfig},
contexts: {interactionTypes.InteractionContextType},
type: interactionTypes.ApplicationCommandType,
nsfw: boolean?
}
Intersection with variants:
Variant 2
Prop | Type | Description |
---|---|---|
name | - | |
nameLocalizations | - | |
description | - | |
descriptionLocalizations | - | |
options | - | |
defaultMemberPermissions? | - | |
integrationTypes | - | |
contexts | - | |
type | - | |
nsfw? | - |
JSON
Raw Type
type JSON = Interaction.Prototype.build(nil :: any),
Functions
Interaction.Prototype.setName
[[ Name of command, 1-32 characters ]]
Function Signature
--[[
Name of command, 1-32 characters
]]
function Interaction.Prototype.setName(self: Interaction, name: string) -> Interaction end
Arguments
name
Returns
ret1
Interaction.Prototype.setType
[[ Set the Type of command ]]
Function Signature
--[[
Set the Type of command
]]
function Interaction.Prototype.setType(self: Interaction, commandType: interactionTypes.ApplicationCommandType) -> Interaction end
Arguments
commandType
interactionTypes.ApplicationCommandType
Returns
ret1
Interaction.Prototype.setNameLocalization
[[ Localization dictionary for the name field. Values follow the same restrictions as name ]]
Function Signature
--[[
Localization dictionary for the name field. Values follow the same restrictions as name
]]
function Interaction.Prototype.setNameLocalization(self: Interaction, localization: apiTypes.LanguageLocales, name: string) -> Interaction end
Arguments
localization
name
Returns
ret1
Interaction.Prototype.setDescription
[[ 1-100 character description ]]
Function Signature
--[[
1-100 character description
]]
function Interaction.Prototype.setDescription(self: Interaction, description: string) -> Interaction end
Arguments
description
Returns
ret1
Interaction.Prototype.setDescriptionLocalization
[[ Localization dictionary for the description field. Values follow the same restrictions as description ]]
Function Signature
--[[
Localization dictionary for the description field. Values follow the same restrictions as description
]]
function Interaction.Prototype.setDescriptionLocalization(self: Interaction, localization: apiTypes.LanguageLocales, description: string) -> Interaction end
Arguments
localization
description
Returns
ret1
Interaction.Prototype.option
Function Signature
function Interaction.Prototype.option(self: Interaction, fn: (interactionOption.Option) -> interactionOption.JSON) -> Interaction end
Arguments
fn
Function Signature
fn: (interactionOption.Option) -> interactionOption.JSON
Arguments
arg1
Returns
ret1
Returns
ret1
Interaction.Prototype.addOption
[[ the parameters for the command ]]
Function Signature
--[[
the parameters for the command
]]
function Interaction.Prototype.addOption(self: Interaction, option: interactionOption.JSON) -> Interaction end
Arguments
option
Returns
ret1
Interaction.Prototype.setDefaultMemberPermissions
[[ Set of permissions represented as a bit set, recommended that you use the permission builder. ]]
Function Signature
--[[
Set of permissions represented as a bit set, recommended that you use the permission builder.
]]
function Interaction.Prototype.setDefaultMemberPermissions(self: Interaction, permissions: string) -> Interaction end
Arguments
permissions
Returns
ret1
Interaction.Prototype.addIntegrationType
[[ Installation context(s) where the command is available ]]
Function Signature
--[[
Installation context(s) where the command is available
]]
function Interaction.Prototype.addIntegrationType(self: Interaction, type: applicationTypes.IntegrationTypesConfig) -> Interaction end
Arguments
type
applicationTypes.IntegrationTypesConfig
Returns
ret1
Interaction.Prototype.addContext
[[ Interaction context(s) where the command can be used ]]
Function Signature
--[[
Interaction context(s) where the command can be used
]]
function Interaction.Prototype.addContext(self: Interaction, context: interactionTypes.InteractionContextType) -> Interaction end
Arguments
context
interactionTypes.InteractionContextType
Returns
ret1
Interaction.Prototype.setNsfw
[[ Indicates whether the command is age-restricted ]]
Function Signature
--[[
Indicates whether the command is age-restricted
]]
function Interaction.Prototype.setNsfw(self: Interaction, isNsfw: boolean) -> Interaction end
Arguments
isNsfw
Returns
ret1
Interaction.Prototype.build
[[ Responsible for buillding the default reaction object that the Discord API can understand. ]]
Function Signature
--[[
Responsible for buillding the default reaction object that the Discord API can understand.
]]
function Interaction.Prototype.build(self: Interaction) -> JSON end
Returns
ret1
Interaction.Interface.new
[[ Constructor for the Discord Default Reaction Builder.
```lua local defaultReaction = Interaction.new("000000000000000000", "secret-emoji"):build() ``` ]]
Function Signature
--[[
Constructor for the Discord Default Reaction Builder.
\`\`\`lua
local defaultReaction = Interaction.new("000000000000000000", "secret-emoji"):build()
\`\`\`
]]
function Interaction.Interface.new(resource: {
name: string?,
nameLocalizations: {
[apiTypes.LanguageLocales]: string
}?,
description: string?,
descriptionLocalizations: {
[apiTypes.LanguageLocales]: string
}?,
options: {interactionOption.JSON}?,
defaultMemberPermissions: string?,
integrationTypes: {applicationTypes.IntegrationTypesConfig}?,
contexts: {interactionTypes.InteractionContextType}?,
nsfw: boolean?
}?) -> Interaction end
Arguments
resource
This field is optional and may not be specified
{name: string?, nameLocalizations: {[apiTypes.LanguageLocales]: string}?, description: string?, descriptionLocalizations: {[apiTypes.LanguageLocales]: string}?, options: {interactionOption.JSON}?, defaultMemberPermissions: string?, integrationTypes: {applicationTypes.IntegrationTypesConfig}?, contexts: {interactionTypes.InteractionContextType}?, nsfw: boolean?}?
Returns
ret1
Last updated on