How to know if a slash command is executed in a thread|post or in a channel ?

Hi, I don't understand how to check if the ChatInputInteraction was executed on a channel or a thread since there is no "threadId" property. Does anyone could help me please ?
6 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
nullopt
nullopt2y ago
interaction.channel.isThread();
// or
interaction.channel.type === ChannelType.PublicThread
interaction.channel.isThread();
// or
interaction.channel.type === ChannelType.PublicThread
Apokalypt
ApokalyptOP2y ago
Thanks but the channel is typed as "optional" so if it's the case I will not be able to perform this check :/
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Apokalypt
ApokalyptOP2y ago
According to the type it's still mark as nullable 😅
Apokalypt
ApokalyptOP2y ago
I don't exactly know how djs handle the cache of channels 🤷‍♂️
Want results from more Discord servers?
Add your server