GuildChannel

class GuildChannel()

Base class for all guild-bound channels (text, voice, category, forum, stage, etc.).

exported from lib.weeble.d

Extends:

Properties

GuildChannel.guildId

type: readonly string

ID of the guild this channel belongs to.

GuildChannel.name

type: readonly string | undefined

Channel name.

GuildChannel.parentId

type: readonly string | null | undefined

ID of the parent category channel, or null when not categorized. undefined when the payload omitted it.

GuildChannel.permissionOverwrites

type: readonly { allow: string; deny: string; id: string; type: PermissionOverwriteType; }[] | undefined

Permission overwrites applied to this channel. Each entry has an allow and deny bitfield as decimal strings. undefined when the payload omitted the list (not the same as an empty list).

GuildChannel.permissions

type: readonly ChannelPermissionManager

Manager for permission overwrites on this channel.

GuildChannel.position

type: readonly number | undefined

Position in the channel list (left-to-right, top-to-bottom).

GuildChannel.url

type: readonly string

Discord 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.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.getInvites() 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.

async GuildChannel.getRolePermissions(role: Role) Promise<bigint>

Get the effective permission bitmask for a role in this channel.

Parameters:
  • role — – The role to check.

Returns:

The permission bitmask.

GuildChannel.toMention() string

Returns <#channelId> mention syntax.

Returns:

The mention string for this channel.