#Accessing Subcommands v14

15 messages · Page 1 of 1 (latest)

charred creek
#

Hello, I'm currently upgrading my bot to djs v14, but I ran into an issue with subcommands. I'm not sure how to access them, since the function CommandInteraction.options.getSubcommand() has been removed in v14. Is there another method to accessing them?

#

I was thinking that it was something like this, but that doesn't seem to be working either.

red kiln
#

no it hasnt

#

The type is ChatInputCommandInteraction, not the base CommandInteraction

charred creek
#

ahhh i see

#

so how would i get that

#

my command handler passes through the CommandInteraction

red kiln
#

No it doesnt lol

digital flint
#

<ChatInputCommandInteraction>.options.getSubcommand()

charred creek
#

so i was just misusing types then

red kiln
#

Yeah

charred creek
#

ok

#

thanks guys :)

red kiln
#

If you've typeguarded it using .isChatInputCommand() then thats what it is