Class

GuildChannel

A channel in a guild (text, voice, category, etc.).

Extends Channel

Constructor

new GuildChannel(client: Client, data: APIChannel)
client
Client

Properties

NameTypeDescription
guildIdread-onlystring | nullGuild ID this channel belongs to, or null if missing from the payload.
namestring | null
parentIdstring | nullParent category ID, or null if none.
permissionOverwritesread-onlyPermissionOverwriteManagerPermission overwrites for roles/members.
position?numberPosition in the channel list.

Methods

.canSend()

Promise<boolean>

Like canSendMessage, but hydrates members.me via REST when missing. Returns false when the channel has no guildId.

await channel.canSend();

.canSendMessage()

boolean

Check if the bot can send messages in this channel (cache-only; needs members.me).

channel.canSendMessage();

.createWebhook(options)

options: { name: string; avatar?: string | null; }Promise<Webhook>

Create a webhook for this channel. Requires Manage Webhooks.

await channel.createWebhook(options);

.fetchInvites()

Promise<Invite[]>

Fetch all invites for this channel. Requires Manage Channels.

await channel.fetchInvites();

.fetchWebhooks()

Promise<Webhook[]>

Fetch all webhooks in this channel. Requires Manage Webhooks.

await channel.fetchWebhooks();