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
Apokalypt2y 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
Apokalypt2y ago
According to the type it's still mark as nullable 😅
Apokalypt
Apokalypt2y ago
I don't exactly know how djs handle the cache of channels 🤷‍♂️