How to get subcommand name from interaction object?

I am will be having multiple commands which have their own sub commands (3 sub command per parent command). Out of those 3 sub commands, 2 of them will have AutoComplete. How do I distinguish between sub commands? interaction.commandName gives only the parent command name, not sub command name
Solution:
After some research I found out that this can be done using:
interaction.options.getSubcommand()
interaction.options.getSubcommand()
...
Solution
M
MRDGH2821409d ago
After some research I found out that this can be done using:
interaction.options.getSubcommand()
interaction.options.getSubcommand()
This gives the sub command name by which you can do respective operations
F
Favna409d ago
You're correct. Should also note that this is DJS btw, not sapphire 🙂
M
MRDGH2821409d ago
I realised this after finding out the solution 😅 For some reason, my autocomplete doesn't work, on which I'll do more research & maybe create appropriate thread
F
Favna409d ago
Make sure that the option has autocomplete enabled in the registry and that it's a supported type. Also make sure the interaction handler is in the correct folder and such (interaction-handlers by default). And the handler has the correct type. Quite a few things to account for. It should all be covered in our guide. https://www.sapphirejs.dev/docs/Guide/interaction-handlers/autocomplete
Sapphire Framework
Autocomplete | Sapphire
Certain Chat Input Command options can be autocompleted based on what the user has written. There are two ways you can
Want results from more Discord servers?
Add your server
More Posts
How do I listen for reactions on all messages in a channel?doing discord bot dev after a long time. i wanted to listen for message reactions on every message iMessageCreate Event isn't workingThis is the first listener Im creating I've read the documentation 50 times imo and checked out the How big is the difference between xyz.cache.get() and await xzy.fetch()?fetch returns the cached thing aswell if it exists, so except the Promise difference i see not reallNOT WORK SAPPHIREwhy not work bot commands?Throwing on unhandled interactionHey, I just wanted to quickly check this idea - If I assign a listener to interaction create and theReply During CooldownCan I make the bot reply with the remaining time of cooldown delay ?messageUpdate event not Triggering```ts import { Listener } from '@sapphire/framework'; import type { Message } from 'discord.js'; exp'"discord.js"' has no exported member named 'WebhookEditMessageOptions'. Did you mean 'WebhookFetchMError: '"discord.js"' has no exported member named 'WebhookEditMessageOptions'. Did you mean 'WebhooMonoreposDoes Sapphire work and play nice with monorepos?Question regarding slash commands / aliasesHi, is there a way for me to register command aliases as slash commands as well? For example: Commandisable commands by dashboard.I want to disable commands through dashboard so, is there any way to dynamically disable commands ?What is the difference between response.status and response.statusCode ?When using the API Plugin of Sapphire.Hey what is DEVELOPMENT MODE and how do I disable itI tried setting the Node_Env to something else but it did not change it in the consoleBotList Autopost of stats is not workingI am using the bot list plugin https://github.com/devtomio/sapphire-plugin-botlist I set everything Miss matching objects on permission setting.Typescript says that permissionOverwrites does not exits in GuildBasedChannel, even tho it exists, irequiredClientPermissions check always rejectingWhile `requiredUserPermissions: ['ManageRoles']` works great. The client check `requiredClientPermis