sapphire-support
Root Question Message
const channel = client.channels.cache.get('1076251641625456700');
channel.send("Hi");
TextChannel
because you cant be sure its a text channel. Second, channel
is not a TextChannel
, its undefined
.client.channels.fetch(...)
const channel = await client.channels.fetch("1076251641625456700");
if(channel?.isTextBased() ) {
channel.send("Hello World!")
}
isStageChannel
function from @sapphire/discord.js-utilities and update to the latest sapphire framework as announced in #737142071319855105!isStageChannel(channel)
isStageChannel
instead of isTextBased
? Wouldnt !isStageChannel(channel)
return true for categries & voice channels?.send
exists on forum channels but I could be wrong about thatisTextChannel
doesn't exclude stage channel!isStageChannel
still assumes that you can send a message to a category which I'm pretty sure you cant.if (!isTextChannel(channel) || isStageChannel(channel) {
return;
}
// do other stuff