• Checks if a channel with a specified name exists within a guild.

    Parameters

    • token: string

      The token used for authentication with the Discord API.

    • guildId: string

      The ID of the guild to check.

    • channelName: string

      The name of the channel to look for.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the channel exists.

    Throws

    Will throw an error if the REST API call fails.

    Example

    const token = 'your_discord_token_here';
    const guildId = 'your_guild_id_here';
    const channelName = 'general';

    isChannelExist(token, guildId, channelName)
    .then(exists => console.log(exists ? 'Channel exists.' : 'Channel does not exist.'))
    .catch(error => console.error(`Error: ${error.message}`));

Generated using TypeDoc