Results

Namespace

Type

A base class containing properties and methods available for all channels that reside in a guild.

You should never create/receive an instance of this class directly.

Hierarchy

Implements

Index

Type aliases

Static AnyChannel

Represents any channel type on Discord.

Static AnyGuildChannel

Represents any channel type on Discord that exists within a discord.Guild.

Properties

Readonly guildId

guildId: Snowflake

The id of the discord.Guild this channel resides in.

Readonly id

Discord's unique identifier for this channel. This value never changes.

Readonly name

name: string

The name of this channel.

Readonly parentId

parentId: Snowflake | null

If the channel resides within a discord.GuildCategory, its id is set on this property.

Readonly permissionOverwrites

permissionOverwrites: IPermissionOverwrite[]

Any member or role-specific permission overwrite settings for this channel.

Note: You should use discord.GuildChannel.getMemberPermissions or the easier discord.GuildChannel.canMember function to test member permissions for a given channel.

Readonly position

position: number

The position in the channel list this channel should be displayed at.

Readonly type

The type of this channel. See discord.Channel.AnyGuildChannel for a complete list of channel types.

Methods

canMember

canRole

  • canRole(role: Role, permission: Permissions): boolean
  • Determines if a role can perform actions that require the permission specified in this channel.

    The permissions are calculated by finding the role in discord.GuildChannel.permissionOverwrites and applying on top of the everyone role permissions for the channel.

    Parameters

    • role: Role

      The Role you want to calculate channel-specific permissions for.

    • permission: Permissions

      The permission you are checking for. Check discord.Permissions for an exhaustive list of all permissions.

    Returns boolean

    true if the permission is granted, otherwise false.

createInvite

delete

  • delete(): Promise<void>
  • Attempts to delete the channel.

    If an error occurs, a discord.ApiError exception is thrown.

    Returns Promise<void>

edit

getGuild

  • getGuild(): Promise<Guild>
  • Fetches the data for the guild this channel belongs to.

    Returns Promise<Guild>

getInvites

getMemberPermissions

getParent

getRolePermissions

  • getRolePermissions(role: Role): number
  • Returns the calculated role permissions for this channel.

    The permissions are calculated by finding the role in discord.GuildChannel.permissionOverwrites and applying on top of the everyone role permissions for the channel.

    Note: If you just want to see if a role has a permission, use discord.GuildChannel.canRole.

    Parameters

    • role: Role

      The Role you want to calculate channel-specific permissions for.

    Returns number

    The permission bit set calculated for the given role.

toMention

  • toMention(): string
  • Returns a mention string in the format of <#id> where id is the id of this channel.

    Can be used in a message to render a link to this channel.

    Returns string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc