Retrieve which subcommand was ran from message and interaction

Ive been wondering if it is possible to retrieve which subcommand was ran or to get only the arg without the command/subcommand from the message? I could manually have it set to a value for each subcommand but i wanted to know if i can already retrieve that from a preexisting sapphire object
5 Replies
Lioness100
Lioness10017mo ago
Is interaction.options.getSubcommand() what you're looking for?
vladantd
vladantdOP17mo ago
does it have a message command variant? sorry im at work rn
Lioness100
Lioness10017mo ago
You could probably do message.content.split(/ +/)[1]. Or look into the source code and see how it classifies the subcommand originally
vladantd
vladantdOP17mo ago
yeah sounds good, ill do that, thanks
Favna
Favna17mo ago
It's not provided from the lib so you'll have to do something like what Lioness suggested
Want results from more Discord servers?
Add your server