Skip to main content

Function: isTextBasedChannel()

isTextBasedChannel(channel: Nullish | ChannelTypes): channel is DMChannel | PartialDMChannel | NewsChannel | StageChannel | TextChannel | PrivateThreadChannel | PublicThreadChannel<boolean> | VoiceChannel

Checks whether a given channel is a TextBasedChannelTypes. This means it has a send method.

Parameters

ParameterTypeDescription
channelNullish | ChannelTypesThe channel to check.

Returns

channel is DMChannel | PartialDMChannel | NewsChannel | StageChannel | TextChannel | PrivateThreadChannel | PublicThreadChannel<boolean> | VoiceChannel

Source

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:157