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
The unique identifier for this application. This is a Discord snowflake that represents when this application was created and other metadata.
name
The name of the application as it appears on Discord. This is what users will see when they interact with your application.
icon
The icon hash of the application. This can be used to generate the application’s icon URL for display purposes.
description
A detailed description of what your application does. This appears in various places across Discord’s interface.
rpcOrigins
An array of allowed RPC origin URLs. These URLs are permitted to make RPC connections to your application if RPC is enabled.
botPublic
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
Determines the OAuth2 flow behavior. When true, users must complete the full OAuth2 code grant flow before the bot can join their server.
bot
The bot user associated with this application. Contains information about the bot’s Discord user account.
termsOfServiceUrl
A URL linking to your application’s terms of service. This should contain important legal information about using your application.
privacyPolicyUrl
A URL linking to your application’s privacy policy. This should detail how you handle user data and privacy concerns.
owner
The Discord user who owns this application. This user has full control over the application’s settings and behavior.
summary
A brief summary of your application. This appears in various places across Discord’s interface where a shorter description is needed.
verifyKey
A hex-encoded key used for verification in interactions and the GameSDK’s GetTicket. This is important for security verification.
team
Information about the team that owns and manages this application. Teams allow multiple users to collaborate on an application.
guildId
For applications that are games sold on Discord, this is the ID of the guild that the game has been linked to.
guild
For applications that are games sold on Discord, this represents the guild that the game has been linked to.
primarySkuId
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
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
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
The public flags associated with this application. These flags can indicate various features or states of the application.
installParams
The default parameters used when installing the application. These parameters configure how the application is set up when added to a server.
integrationTypesConfig
{ [apiTypes.IntegrationTypesConfig]: boolean } }
Configuration settings for different types of integrations. This determines what integration options are available for the application.
customInstallUrl
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 ( ) -> ()
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.