GuildChannel
- class GuildChannel
Base class for all guild-bound channels (text, voice, category, forum, stage, etc.).
- Extends:
Properties
Property
Type
Description
guildIdID of the guild this channel belongs to.
nameChannel name.
parentIdID of the parent category channel, or
nullwhen not categorized.undefinedwhen the payload omitted it.permissionOverwrites{ allow: string; deny: string; id: string; type:
PermissionOverwriteType; }[] | undefinedPermission overwrites applied to this channel. Each entry has an
allowanddenybitfield as decimal strings.undefinedwhen the payload omitted the list (not the same as an empty list).permissionsManager for permission overwrites on this channel.
positionPosition in the channel list (left-to-right, top-to-bottom).
urlDiscord URL to jump to this channel.
Methods
-
async GuildChannel.canMember(permission: bigint, member:
GuildMember) Promise<boolean> Check if a member has a specific permission in this channel.
- Parameters:
permission: The permission flag to check.
member: The guild member to check.
- Returns:
Whether the member has the permission.
-
async GuildChannel.canRole(permission: bigint, role:
Role) Promise<boolean> Check if a role has a specific permission in this channel.
- Parameters:
permission: The permission flag to check.
role: The role to check.
- Returns:
Whether the role has the permission.
- async GuildChannel.clone(options: { name?: string; reason?: string; }) Promise<AnyGuildChannel>
Create a copy of this channel with the same type, category, position, permission overwrites, and settings such as topic, slowmode, bitrate, and user limit. Messages and threads are not copied.
- Returns:
The new channel.
-
async GuildChannel.createInvite(options:
InviteCreateOptions) Promise<Invite> Create an invite for this channel.
- Parameters:
options: Optional invite settings (max age, max uses, etc.).
- Returns:
The created invite.
-
async GuildChannel.fetchGuild() Promise<
Guild> Fetch the guild this channel belongs to from Discord.
- Returns:
The guild object.
-
async GuildChannel.fetchInvites() Promise<
Invite[]> Fetch all invites for this channel.
- Returns:
Array of invites.
-
async GuildChannel.getMemberPermissions(member:
GuildMember) Promise<bigint> Get the effective permission bitmask for a specific member in this channel (accounting for overwrites).
- Parameters:
member: The guild member to check.
- Returns:
The permission bitmask.