Skip to content
SinisterRectus edited this page Jan 14, 2017 · 28 revisions

Represents a Discord guild text channel.

Objects Accessible via Caches

  • Messages
  • PermissionOverwrites

Properties Inherited From Channel

Name Type Mutable Description
isPrivate boolean Whether the channel is private
type string The channel type (text or voice)

Properties Inherited From Container

Name Type Mutable Description
client Client Client object to which the Discord object is known
parent * Parent Discord object

Properties Inherited From GuildChannel

Name Type Mutable Description
guild Guild The guild in which the channel exists
invites function Returns an iterator for the channel's invites (not cached)
name string X The name of the guild channel
permissionOverwriteCount number How many PermissionOverwrites are cached for the channel.
permissionOverwrites function Iterator for the channel's cached PermissionOverwrites.
position number X The position of the channel in the guild's list of channels

Properties Inherited From Snowflake

Name Type Mutable Description
createdAt number Unix time in seconds at which the object was created by Discord
id string Snowflake ID for the object
timestamp string ISO 8601 date and time at which the object was created by Discord

Properties Inherited From TextChannel

Name Type Mutable Description
messageCount number How many Messages are cached for the channel.
messages function Iterator for the channel's cached Messages.
pinnedMessages function Iterator for all of the pinned messages in the channel

Class Properties

Name Type Mutable Description
mentionString string Raw string that is parsed by Discord into a user mention
topic string X The channel topic (at the top of the channel in the Discord client)

Methods Inherited From Channel

Prototype Description
delete() Deletes the channel. This cannot be undone for guild channels!

Methods Inherited From GuildChannel

Prototype Description
createInvite(maxAge, maxUses, temporary, unique) Creates and returns an invite to the channel for users to join.
getPermissionOverwriteFor(object) Returns an overwrite for the provided Role or Member

Methods Inherited From TextChannel

Prototype Description
broadcastTyping() Causes the 'User is typing...' indicator to show in the channel.
getMessageHistory([limit]) Returns an iterator for 1 to 100 (default: 50) of the most recent messages in the channel.
getMessageHistoryAfter(message[, limit]) Get message history after a specific message.
getMessageHistoryAround(message[, limit]) Get message history around a specific message.
getMessageHistoryBefore(message[, limit]) Get message history before a specific message.
loadMessages([limit]) Downloads 1 to 100 (default: 50) of the channel's most recent messages into the channel cache.
sendMessage(content) Sends a message to the channel. Content is a string or table.

Class Methods

Prototype Description
bulkDelete([limit]) Deletes 1 to 100 (default: 50) of the most recent messages from the channel and returns an iterator for them.
bulkDeleteAfter(message[, limit]) Bulk delete after a specific message.
bulkDeleteAround(message[, limit]) Bulk delete around a specific message.
bulkDeleteBefore(message[, limit]) Bulk delete before a specific message.
Clone this wiki locally