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-onlystringGuild ID this channel belongs to.
namestring | null
parentIdstring | nullParent category ID, or null if none.
permissionOverwritesAPIChannelOverwrite[]Permission overwrites for roles/members.
position?numberPosition in the channel list.

Methods

.canSendMessage()

→ boolean

Check if the bot can send messages in this channel (with permissions).

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);

.delete(options?)

options?: SudoVerificationOptions & { silent?: boolean; deleteMessages?: boolean } → Promise<void>

Delete this channel. Requires Manage Channels or channel ownership.

await channel.delete();

.deletePermission(overwriteId)

overwriteId: string → Promise<void>

Delete a permission overwrite. Requires Manage Roles.

await channel.deletePermission(overwriteId);

.editPermission(overwriteId, options)

overwriteId: string, options: { type: OverwriteType; allow?: string; deny?: string; } → Promise<void>

Edit or create a permission overwrite. Requires Manage Roles.

await channel.editPermission(overwriteId, 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();