Why ChatInputCommandInteraction can return a null channel?

No description
5 Replies
d.js toolkit
d.js toolkit5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Svitkona
Svitkona5mo ago
looking at the source, interaction.channel is a getter that grabs the channel from the cache, and theoretically it might not be present https://github.com/discordjs/discord.js/blob/14.15.3/packages/discord.js/src/structures/BaseInteraction.js#L136
orion
orionOP5mo ago
oooh, i see But a ChatInputCommandInteraction is a SlashCommand that was called in a chat, so in theory it should always return a channel, no? Because a ChatInput always will be called in a TextChannel I don't know if i'm wrong
chewie
chewie5mo ago
Not if you do sketchy things with custom caches or missing intents use the inCachedGuild() typeguard
orion
orionOP5mo ago
i see, thanks guys for the help ❤️
Want results from more Discord servers?
Add your server