Default of integration types of an application command
I'm currently working on my bot updating all application commands when started, if modified (using
equals() of the "ApplicationCommand" class). Doing so, I ran into the problem, that every application command is updated every single time I start the bot. Some debugging and research later, I've come to the conclusion, that the integration types of the registered command and the locally saved command are not equal.
In the documentation provided by Discord on application commands it says, that integration_type defaults to the app's "configured contexts". As I understand, this refers to client.application.integrationTypesConfig. I enabled both "GUILD INSTALL" and "USER INSTALL" for my bot on the Discord developer website, so this looks like this:
When searching for any default values in the discord.js and API code, I found this: It says, that integration_types defaults to [ApplicationIntegrationType.GuildInstall]. This actually matches what I experienced with all my commands; they all only got this single integration type. Furthermore, while searching the code for a default value, I've found out, that this default value is not set by discord.js but Discord itself.3 Replies
Does anyone have suggestions, how I can fix this problem, without just hardcoding, that the default value in the official documentation of Discord obviously is
ApplicationIntegration.GuildInstall?
I'm not sure if code snippets would be helpful in understanding my problem or finding solutions, as it's more related to Discord and discord.js. If anyone needs any, please let me know. Otherwise, you can find the entire code under the master branch of my repository.tbh ideally you should only deploy when you change your commands, they should not change that frequently that you need a system to detect the changes