Results

Namespace

Type

A text chat channel within a discord.Guild.

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 nsfw

nsfw: boolean

If true, sets the NSFW setting to enabled for 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 rateLimitPerUser

rateLimitPerUser: number | null

How often (in seconds) users are able to send messages.

The default value of 0 means the feature is disabled for this channel.

Note: Discord calls this "slow-mode".

Readonly topic

topic: string | null

The topic displayed above this channel.

Readonly type

The type of this channel. Always Channel.Type.GUILD_TEXT.

Methods

bulkDeleteMessages

  • bulkDeleteMessages(messages: Iterable<Snowflake>): Promise<void>
  • Bulk-deletes messages from the channel. The bot must have MANAGE_MESSAGES permission in the channel to perform this action.

    You must supply no less than 2 and no greater than 100 messages to be deleted.

    If any supplied message is older than 2 weeks, the request will fail.

    Note: This action, when completed, will fire a discord.Event.MESSAGE_DELETE_BULK event.

    If an error occurs, a discord.ApiError exception will be thrown.

    Parameters

    • messages: Iterable<Snowflake>

      An iterable (Array, Set, etc) of message ids to delete.

    Returns Promise<void>

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

getMessage

  • getMessage(messageId: string): Promise<Message | null>
  • Attempts to fetch a single discord.Message (by id) from this channel.

    If no message is found, the Promise resolves as null.

    Parameters

    • messageId: string

      The id of the message you wish to fetch data for.

    Returns Promise<Message | null>

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.

sendMessage

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

triggerTypingIndicator

  • triggerTypingIndicator(): Promise<void>
  • Triggers the *Username* is typing... message to appear near the text input box for users focused on the channel.

    The typing indicator will last up to 15 seconds, or until the bot user sends a message in the channel. Whatever comes first.

    Typically unused by bots, but can be used to indicate a command response is "loading" or "processing."

    Returns Promise<void>

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