Skip to content
SinisterRectus edited this page Nov 6, 2016 · 22 revisions

Represents a Discord private text channel between two users.

Objects Accessible via Caches

  • Messages

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 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

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
name string The username of the channel recipient
recipient User The recipient of the private channel (the other half of your conversation)

Methods Inherited From Channel

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

Methods Inherited From TextChannel

Prototype Description
broadcastTyping() Causes the 'User is typing...' indicator to show in the channel.
bulkDelete([limit]) Permanently deletes 1 to 100 (default: 50) of the most recent messages from the channel.
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.
getMessageById(id) Returns a message from the channel cache or from Discord if it is not cached.
getMessageHistory([limit]) Returns an iterator 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[, mentions, tts, nonce]) Sends a message to the channel.
Clone this wiki locally