Results

Namespace

Type

A category within a guild. Can be used to separate groups of channels under a single parent.

Guild channels within categories will have a channel id specified on discord.GuildChannel.parentId.

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 name

name: string

The name of this channel.

Readonly parentId

parentId: null

Categories may not be nested, they will always have a null parentId.

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. Always Channel.Type.GUILD_CATEGORY.

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

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