Constructor
new GuildTextableChannel()
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 |
messages |
Collection.<Message>
|
Collection of Messages in this channel |
|
rateLimitPerUser |
Number
|
The time in seconds a user has to wait before sending another message (0-21600) (does not affect bots or users with manageMessages/manageChannel permissions) |
Methods
addMessageReaction(messageID, reaction) → {Promise}
Add a reaction to a message
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
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>
deleteMessage(messageID, reasonopt) → {Promise}
Delete a message
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
messageID |
String
|
The ID of the message |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise
deleteMessages(messageIDs, reasonopt) → {Promise}
Bulk delete messages (bot accounts only)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
messageIDs |
Array.<String>
|
Array of message IDs to delete |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise
editMessage(messageID, content) → {Promise.<Message>}
Edit a message
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>
endPoll(messageID) → {Promise.<Message>}
Immediately end a poll. Note: You cannot end polls from other users.
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message that the poll is in |
Returns:
- Type:
-
Promise.<Message>
getMessage(messageID) → {Promise.<Message>}
Get a previous message in the channel
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
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
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>>
getPollAnswerVoters(messageID, answerID, optionsopt) → {Promise.<Array.<User>>}
Get a list of users that voted for a specific poll answer
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
messageID |
String
|
The ID of the message that the poll is in |
||||||||||||||||
answerID |
Number
|
The ID of the answer to get voters for |
||||||||||||||||
options |
Object
|
<optional> |
Options for the request
|
purge(options, filteropt, beforeopt, afteropt, reasonopt) → {Promise.<Number>}
Purge previous messages in the channel with an optional filter
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
Options for the request. If this is a number ([DEPRECATED] behavior), it is treated as
|
|||||||||||||||||||||||||
filter |
function
|
<optional> |
[DEPRECATED] Optional filter function that returns a boolean when passed a Message object |
||||||||||||||||||||||||
before |
String
|
<optional> |
[DEPRECATED] Get messages before this message ID |
||||||||||||||||||||||||
after |
String
|
<optional> |
[DEPRECATED] Get messages after this message ID |
||||||||||||||||||||||||
reason |
String
|
<optional> |
[DEPRECATED] The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<Number>
Resolves with the number of messages deleted
removeMessageReaction(messageID, reaction, userIDopt) → {Promise}
Remove a reaction from a message
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 |
Returns:
- Type:
-
Promise
removeMessageReactionEmoji(messageID, reaction) → {Promise}
Remove all reactions from a message for a single emoji
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
reaction |
String
|
The reaction (Unicode string if Unicode emoji, |
Returns:
- Type:
-
Promise
removeMessageReactions(messageID) → {Promise}
Remove all reactions from a message
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
Returns:
- Type:
-
Promise
sendTyping() → {Promise}
Send typing status in the channel
Returns:
- Type:
-
Promise
unsendMessage(messageID) → {Promise}
Un-send a message. You're welcome Programmix
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
Returns:
- Type:
-
Promise