Skip to content

Application

Implementation of the Discord Application class in Luau. This class represents a Discord application and provides methods to manage application commands and properties.

https://discord.com/developers/docs/resources/application#application-object

Properties

id

Application.id  :: string

The unique identifier for this application. This is a Discord snowflake that represents when this application was created and other metadata.

name

Application.name  :: string

The name of the application as it appears on Discord. This is what users will see when they interact with your application.

icon

Application.icon  :: string?

The icon hash of the application. This can be used to generate the application’s icon URL for display purposes.

description

Application.description  :: string

A detailed description of what your application does. This appears in various places across Discord’s interface.

rpcOrigins

Application.rpcOrigins  :: { string }?

An array of allowed RPC origin URLs. These URLs are permitted to make RPC connections to your application if RPC is enabled.

botPublic

Application.botPublic  :: boolean

Controls who can add the bot to servers. When false, only the application owner can add the bot to servers, providing more control over bot distribution.

botRequireCodeGrant

Application.botRequireCodeGrant  :: boolean

Determines the OAuth2 flow behavior. When true, users must complete the full OAuth2 code grant flow before the bot can join their server.

bot

Application.bot  :: Classes.User?

The bot user associated with this application. Contains information about the bot’s Discord user account.

termsOfServiceUrl

Application.termsOfServiceUrl  :: string?

A URL linking to your application’s terms of service. This should contain important legal information about using your application.

privacyPolicyUrl

Application.privacyPolicyUrl  :: string?

A URL linking to your application’s privacy policy. This should detail how you handle user data and privacy concerns.

owner

Application.owner  :: Classes.User?

The Discord user who owns this application. This user has full control over the application’s settings and behavior.

summary

Application.summary  :: string?

A brief summary of your application. This appears in various places across Discord’s interface where a shorter description is needed.

verifyKey

Application.verifyKey  :: string?

A hex-encoded key used for verification in interactions and the GameSDK’s GetTicket. This is important for security verification.

team

Application.team  :: Classes.Team?

Information about the team that owns and manages this application. Teams allow multiple users to collaborate on an application.

guildId

Application.guildId  :: string?

For applications that are games sold on Discord, this is the ID of the guild that the game has been linked to.

guild

Application.guild  :: Classes.UnavailableGuild?

For applications that are games sold on Discord, this represents the guild that the game has been linked to.

primarySkuId

Application.primarySkuId  :: string?

For games sold on Discord, this is the ID of the primary SKU that is created for the game. This represents the main purchasable version of the game.

slug

Application.slug  :: string?

For games sold on Discord, this is the URL-friendly string that links to the store page. This makes it easy to share and access the game’s store listing.

coverImage

Application.coverImage  :: string?

The hash of the default rich presence invite cover image. This image appears when users share your application through Discord’s rich presence feature.

flags

Application.flags  :: Classes.ApplicationBitflag?

The public flags associated with this application. These flags can indicate various features or states of the application.

installParams

Application.installParams  :: Classes.InstallParams?

The default parameters used when installing the application. These parameters configure how the application is set up when added to a server.

integrationTypesConfig

Application.integrationTypesConfig  :: {
      {… [apiTypes.IntegrationTypesConfig]: boolean …}    }

Configuration settings for different types of integrations. This determines what integration options are available for the application.

customInstallUrl

Application.customInstallUrl  :: string?

A custom URL that users can visit to install the application. This can be used to provide a branded or customized installation experience.

Methods

The Application instance has no set methods!

Functions

createSlashCommandAsync

Application . createSlashCommandAsync (

     self: Application
     slashCommand: builders.interactionJSON
)  -> ()

Creates a global Slash Command for the Application, slash commands can take up to 5 minutes to sync, and will require developers to reload their discord client.

For testing/building commands, it’s advised you use guild commands, which do not suffer the same constraints.

deleteSlashCommandAsync

Application . deleteSlashCommandAsync (

     self: Application
     slashCommandId: apiTypes.Snowflake
)  -> ()

Delete an existing global application command.

editSlashCommandAsync

Application . editSlashCommandAsync (

     self: Application
     slashCommandId: apiTypes.Snowflake
     slashCommand: builders.interactionJSON
)  -> ()

Edit an existing global application command.

getSlashCommandsAsync

Application . getSlashCommandsAsync (

     self: Application
     withLocalizations: boolean?
)  -> ()

Get a list of global application commands.

overwriteSlashCommandsAsync

Application . overwriteSlashCommandsAsync (

     self: Application
     slashCommands: { builders.interactionJSON }
)  -> ()

Overwrite all global application commands. This will skip over commands that are the same as the current commands, and will not remove any existing commands.

sync

Application . sync (

     self: Application
     applicationData: apiTypes.ApplicationObject
)  -> ()

Synchronizes the application object with the data from the API.

new

Application . new (

     state: state.State
     applicationData: apiTypes.ApplicationObject
)  -> ()

Creates a new Application instance with the specified application data.