DMChannel

DMChannel

new DMChannel()

Source:
Properties:
Name Type Attributes Description
lastMessageID Snowflake <nullable>

The id of the last message sent

recipients Array.<User>

An array of user recipients on the DM Channel

Extends

Methods

createEmbed(embed) → {Promise.<Message>}

Source:
Deprecated:
  • Use DMChannel#send() instead

Creates an embed to the channel

Parameters:
Name Type Description
embed Object

The embed to send

Returns:
Type
Promise.<Message>

createMessage(content) → {Promise.<Message>}

Source:
Deprecated:
  • Use DMChannel#send() instead

Creates a message to the channel

Parameters:
Name Type Description
content String

The content of the message

Returns:
Type
Promise.<Message>

getMessage(message) → {Promise.<Message>}

Source:

Fetch a single message If Client#storeMessages is true, it will try to fetch the message in the cache. And if it failed it would fetch the message through Discord's REST API And set it in the cache. Otherwise, if it's false, it would just fetch the message through Discord's REST API

Parameters:
Name Type Description
message Snowflake

The id of the message to fetch

Returns:
Type
Promise.<Message>

getMessages(options) → {Promise.<Array.<Message>>}

Source:

Fetches messages for the channel

Parameters:
Name Type Description
options Object

Query options for fetching Message

Properties
Name Type Attributes Default Description
limit Number <optional>
50

Maximum amount of messages to fetch

after Snowflake <optional>

Get messages after this message id

around Snowflake <optional>

Get messages around this message id

before Snowfalke <optional>

Get messages before this message id

Returns:
Type
Promise.<Array.<Message>>

getPinnedMessages() → {Promise.<Array.<Message>>}

Source:

Fetches all the pinned messages in the channel

Returns:
Type
Promise.<Array.<Message>>

patchEmbed(message, content) → {Promise.<Message>}

Source:
Deprecated:
  • Use TextChannel#patchMessage() instead.

Edits a message's embed, not content!

Parameters:
Name Type Description
message Snowflake

The id of the message to edit

content String

The new embed of the message, not content!

Returns:
Type
Promise.<Message>

patchMessage(options) → {Promise.<Message>}

Source:

Edits a message

Parameters:
Name Type Description
options Object

Options for the message editing

Properties
Name Type Description
content String

The content of the message

embed Embed

The embed for the message

message Snowflake

The id of the message

Returns:
Type
Promise.<Message>

send(options) → {Promise.<Message>}

Source:

Sends a message to the channel

Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Description
content String <optional>

The content of the message

embed Embed <optional>

The embed object of the message

Returns:
Type
Promise.<Message>