fetchGuildTextChannel

async fetchGuildTextChannel(channelId: string) Promise<GuildTextChannel | null>

Fetches a guild text or announcement channel. Returns null when the channel has another type or does not exist.

Example

const channel = await discord.fetchGuildTextChannel('123456789012345678');
if (!channel) return console.warn('Invalid logs channel.');
await channel.send('Ready.');
Parameters:
  • channelId — – The channel ID to fetch.