Skip to content
Functiongatewayv0.11.0

checkBotPermissions

Checks the bot's own permissions in a Guild, or in a channel or thread. Refuses when a permission in scope is missing, or with inverse when one is present.

Throws:

  • A Notice when the check refuses. It lists the missing or present permissions.

  • A SeedcordError when the guild's member cache doesn't hold the bot's member.

checkBotPermissions(
    { in: where, ...check },
    input: CheckBotPermissionOptions
): void
import { PermissionFlagsBits } from 'discord.js';
import { checkBotPermissions } from '@seedcord/gateway';

checkBotPermissions({ in: channel, scope: [PermissionFlagsBits.SendMessages, PermissionFlagsBits.ViewChannel] });

{ in: where, ...check }

{ in: where, ...check }