Constructor
new DMChannel()
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
lastMessageID |
String
|
<nullable> |
The ID of the last message in the channel. This can be null if there has never been a message in the channel |
lastPinTimestamp |
Number
|
<nullable> |
The timestamp of the last pinned message |
messages |
Collection.<Message>
|
Collection of Messages in this channel |
|
recipients |
Collection.<User>
|
The recipient in this private channel (this should always contain one entry) |
- Source:
Extends
Methods
addMessageReaction(messageID, reaction) → {Promise}
Add a reaction to a message
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
reaction |
String
|
The reaction (Unicode string if Unicode emoji, |
Returns:
- Type:
-
Promise
createMessage(content, fileopt) → {Promise.<Message>}
Create a message in the channel
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
content |
String
|
Object
|
A string or object. If an object is passed:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
file |
Object
|
Array.<Object>
|
<optional> |
A file object (or an Array of them)
|
Returns:
- Type:
-
Promise.<Message>
delete() → {Promise.<DMChannel>}
Close the DM Channel. This doesn't really concern bots with DMs.
- Source:
Returns:
- Type:
-
Promise.<DMChannel>
deleteMessage(messageID) → {Promise}
Delete a message
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
Returns:
- Type:
-
Promise
editMessage(messageID, content) → {Promise.<Message>}
Edit a message
- Source:
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
messageID |
String
|
The ID of the message |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
content |
String
|
Array
|
Object
|
A string, array of strings, or object. If an object is passed:
|
Returns:
- Type:
-
Promise.<Message>
getMessage(messageID) → {Promise.<Message>}
Get a previous message in the channel
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
Returns:
- Type:
-
Promise.<Message>
getMessageReaction(messageID, reaction, optionsopt, beforeopt, afteropt) → {Promise.<Array.<User>>}
Get a list of users who reacted with a specific reaction
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
messageID |
String
|
The ID of the message |
|||||||||||||||||||||
reaction |
String
|
The reaction (Unicode string if Unicode emoji, |
|||||||||||||||||||||
options |
Object
|
<optional> |
Options for the request. If this is a number, it is treated as
|
||||||||||||||||||||
before |
String
|
<optional> |
[DEPRECATED] Get users before this user ID. Discord no longer supports this parameter |
||||||||||||||||||||
after |
String
|
<optional> |
[DEPRECATED] Get users after this user ID |
Returns:
- Type:
-
Promise.<Array.<User>>
getMessages(optionsopt, beforeopt, afteropt, aroundopt) → {Promise.<Array.<Message>>}
Get previous messages in the channel
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
Options for the request. If this is a number ([DEPRECATED] behavior), it is treated as
|
|||||||||||||||||||||||||
before |
String
|
<optional> |
[DEPRECATED] Get messages before this message ID |
|||||||||||||||||||||||||
after |
String
|
<optional> |
[DEPRECATED] Get messages after this message ID |
|||||||||||||||||||||||||
around |
String
|
<optional> |
[DEPRECATED] Get messages around this message ID (does not work with limit > 100) |
Returns:
- Type:
-
Promise.<Array.<Message>>
getPins(optionsopt) → {Promise.<{hasMore: Boolean, items: Array.<{pinnedAt: Number, message: Message}>}>}
Get pinned messages in the channel
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
The options to use to get pinned messages
|
Returns:
- Type:
-
Promise.<{hasMore: Boolean, items: Array.<{pinnedAt: Number, message: Message}>}>
pinMessage(messageID) → {Promise}
Pin a message
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
Returns:
- Type:
-
Promise
removeMessageReaction(messageID, reaction, userIDopt) → {Promise}
Remove a reaction from a message
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
messageID |
String
|
The ID of the message |
||
reaction |
String
|
The reaction (Unicode string if Unicode emoji, |
||
userID |
String
|
<optional> |
"@me" |
The ID of the user to remove the reaction for. Passing this parameter is deprecated and will not be supported in future versions. |
Returns:
- Type:
-
Promise
sendTyping() → {Promise}
Send typing status in the channel
- Source:
Returns:
- Type:
-
Promise
unpinMessage(messageID) → {Promise}
Unpin a message
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
Returns:
- Type:
-
Promise
unsendMessage(messageID) → {Promise}
Un-send a message. You're welcome Programmix
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
Returns:
- Type:
-
Promise