How to get SubCommand Ids

hello there. I want to create slash command mention from command name and command id. In this case, I can get global command id, but not the subcommand ids.
const allCommands = this.container.stores.get('commands');
for (const command of allCommands) {
console.log(command[1].applicationCommandRegistry.globalCommandId)
}
const allCommands = this.container.stores.get('commands');
for (const command of allCommands) {
console.log(command[1].applicationCommandRegistry.globalCommandId)
}
6 Replies
Favna
Favna2y ago
Subcommands don't have IDs
grarich
grarich2y ago
really? https://discord.com/developers/docs/interactions/application-commands#application-command-object applicationCommand type 1 is a subcommand. i think subcommand have a id.
Discord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Favna
Favna2y ago
They don't. The ID listed there is the ID of the command Subcommands are under the options property
grarich
grarich2y ago
Discord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Discord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Favna
Favna2y ago
Subcommands don't have IDs I don't know how else to tell you And if you don't believe me then ask someone else for a second opinion But don't keep denying it because you're not gonna get anywhere that way
grarich
grarich2y ago
@Favna I terribly sorry about this. I just re-retrieved all the commands from the API and sure enough, there are no IDs in the subcommands. Thank you very much for your thoughtful response.
Want results from more Discord servers?
Add your server