Class

GuildChannel

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

Extends Channel

Constructor

new GuildChannel(client: Client, data: APIChannel)
ParamTypeDescription
clientClient
dataAPIChannel

Properties

guildId: string (readonly)

Guild ID this channel belongs to.

name: string | null
parentId: string | null

Parent category ID, or null if none.

permissionOverwrites: APIChannelOverwrite[]

Permission overwrites for roles/members.

position?: number

Position in the channel list.

Methods

applyEditPatch(: APIChannel): void
ParamTypeDescription
_dataAPIChannel
canSendMessage(): boolean

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

createInvite(options?: ChannelInviteCreateOptions): Promise<Invite>

Create an invite for this channel. Requires Create Instant Invite.

ParamTypeDescription
options?ChannelInviteCreateOptions
createWebhook(options: { name: string; avatar?: string | null; }): Promise<Webhook>

Create a webhook for this channel. Requires Manage Webhooks.

ParamTypeDescription
options{ name: string; avatar?: string | null; }
delete(options?: SudoVerificationOptions & { silent?: boolean; deleteMessages?: boolean }): Promise<void>

Delete this channel. Requires Manage Channels or channel ownership.

ParamTypeDescription
options?SudoVerificationOptions & { silent?: boolean; deleteMessages?: boolean }
deletePermission(overwriteId: string): Promise<void>

Delete a permission overwrite. Requires Manage Roles.

ParamTypeDescription
overwriteIdstring
edit(options: ChannelEditOptions): Promise<this>

Edit this channel's settings. Requires Manage Channels.

ParamTypeDescription
optionsChannelEditOptions
editPermission(overwriteId: string, options: { type: OverwriteType; allow?: string; deny?: string; }): Promise<void>

Edit or create a permission overwrite. Requires Manage Roles.

ParamTypeDescription
overwriteIdstring
options{ type: OverwriteType; allow?: string; deny?: string; }
fetchInvites(): Promise<Invite[]>

Fetch all invites for this channel. Requires Manage Channels.

fetchWebhooks(): Promise<Webhook[]>

Fetch all webhooks in this channel. Requires Manage Webhooks.