Skip to content
SinisterRectus edited this page Apr 16, 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
firstMessage Message The first message found in the channel via HTTP (not cached).
lastMessage Message The last message found in the channel via HTTP (not cached).
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)
webhooks function Returns an iterator for the channel's webhooks (not cached)

Methods Inherited From Channel

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

Methods Inherited From GuildChannel

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

Methods Inherited From TextChannel

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

Class Methods

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