Constructor
new PrivateThreadChannel()
Properties:
| Name | Type | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
threadMetadata |
Object
|
Metadata for the thread |
|||||||||||||||||||||||||
| Name | Type | Attributes | Description |
|---|---|---|---|
archived |
Boolean
|
Whether the thread is archived or not |
|
archiveTimestamp |
Number
|
Timestamp of when the thread's archive status was last changed, used for calculating recent activity |
|
autoArchiveDuration |
Number
|
Duration in minutes to automatically hide the thread after recent activity, either 60, 1440, 4320, or 10080 |
|
createTimestamp |
Number
|
<nullable> |
Timestamp when the thread was created (only available for threads created after 09 January 2022) |
invitable |
Boolean
|
Whether non-moderators can add other non-moderators to the thread |
|
locked |
Boolean
|
Whether the thread is locked or not |
Extends
Methods
addMessageReaction(messageID, reaction) → {Promise}
Add a reaction to a message
- Inherited From:
- 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
- Inherited From:
- 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>
deleteMessage(messageID, reasonopt) → {Promise}
Delete a message
- Inherited From:
- Source:
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)
- Inherited From:
- Source:
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
- Inherited From:
- 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>
endPoll(messageID) → {Promise.<Message>}
Immediately end a poll. Note: You cannot end polls from other users.
- Inherited From:
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message that the poll is in |
Returns:
- Type:
-
Promise.<Message>
getMember(userID, withMemberopt) → {Promise.<ThreadMember>}
Get a member that is part of the thread channel
- Inherited From:
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
userID |
String
|
The ID of the user |
|
withMember |
Boolean
|
<optional> |
Whether to include the guild member object within the response |
Returns:
- Type:
-
Promise.<ThreadMember>
getMembers(optionsopt) → {Promise.<Array.<ThreadMember>>}
Get a list of members that are part of this thread channel
- Inherited From:
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
Options for the request
|
Returns:
- Type:
-
Promise.<Array.<ThreadMember>>
getMessage(messageID) → {Promise.<Message>}
Get a previous message in the channel
- Inherited From:
- 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
- Inherited From:
- 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
- Inherited From:
- 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 thread channel
- Inherited From:
- 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}>}>
getPollAnswerVoters(messageID, answerID, optionsopt) → {Promise.<Array.<User>>}
Get a list of users that voted for a specific poll answer
- Inherited From:
- Source:
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
|
join(userIDopt) → {Promise}
Join a thread
- Inherited From:
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
userID |
String
|
<optional> |
"@me" |
The user ID of the user joining |
Returns:
- Type:
-
Promise
leave(userIDopt) → {Promise}
Leave a thread
- Inherited From:
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
userID |
String
|
<optional> |
"@me" |
The user ID of the user leaving |
Returns:
- Type:
-
Promise
pinMessage(messageID) → {Promise}
Pin a message
- Inherited From:
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
Returns:
- Type:
-
Promise
purge(options, filteropt, beforeopt, afteropt, reasonopt) → {Promise.<Number>}
Purge previous messages in the channel with an optional filter
- Inherited From:
- Source:
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
- Inherited From:
- 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 |
Returns:
- Type:
-
Promise
removeMessageReactionEmoji(messageID, reaction) → {Promise}
Remove all reactions from a message for a single emoji
- Inherited From:
- Source:
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
- Inherited From:
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
Returns:
- Type:
-
Promise
sendTyping() → {Promise}
Send typing status in the channel
- Inherited From:
- Source:
Returns:
- Type:
-
Promise
unpinMessage(messageID) → {Promise}
Unpin a message
- Inherited From:
- 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
- Inherited From:
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
Returns:
- Type:
-
Promise