Constructor
new TextChannel()
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
defaultAutoArchiveDuration |
Number
|
The default duration of newly created threads in minutes to automatically archive the thread after inactivity (60, 1440, 4320, 10080) |
|
lastPinTimestamp |
Number
|
<nullable> |
The timestamp of the last pinned message |
nsfw |
Boolean
|
Whether the channel is an NSFW channel or not |
|
permissionOverwrites |
Collection.<PermissionOverwrite>
|
Collection of PermissionOverwrites in the channel |
|
position |
Number
|
The position of the channel |
|
topic |
String
|
<nullable> |
The topic of the channel |
- Source:
Extends
Methods
addMessageReaction(messageID, reaction) → {Promise}
Add a reaction to a message
- Overrides:
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
reaction |
String
|
The reaction (Unicode string if Unicode emoji, |
Returns:
- Type:
-
Promise
createInvite(optionsopt, reasonopt) → {Promise.<Invite>}
Create an invite for the channel
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
Invite generation options
|
||||||||||||||||||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<Invite>
createMessage(content, fileopt) → {Promise.<Message>}
Create a message in the channel
- Overrides:
- 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>
createThread(options) → {Promise.<(NewsThreadChannel|PublicThreadChannel|PrivateThreadChannel)>}
Create a thread without an existing message
- Source:
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The thread options
|
Returns:
- Type:
-
Promise.<(NewsThreadChannel|PublicThreadChannel|PrivateThreadChannel)>
createThreadWithMessage(messageID, options) → {Promise.<(NewsThreadChannel|PublicThreadChannel)>}
Create a thread with an existing message
- Source:
Parameters:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
messageID |
String
|
The ID of the message to create the thread from |
||||||||||||||||||||
options |
Object
|
The thread options
|
Returns:
- Type:
-
Promise.<(NewsThreadChannel|PublicThreadChannel)>
createThreadWithoutMessage(options) → {Promise.<(NewsThreadChannel|PublicThreadChannel|PrivateThreadChannel)>}
[DEPRECATED] Create a thread without an existing message. Use createThread instead
- Source:
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The thread options
|
Returns:
- Type:
-
Promise.<(NewsThreadChannel|PublicThreadChannel|PrivateThreadChannel)>
deleteMessage(messageID, reasonopt) → {Promise}
Delete a message
- Overrides:
- 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)
- Overrides:
- 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
deletePermission(overwriteID, reasonopt) → {Promise}
Delete a channel permission overwrite
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
overwriteID |
String
|
The ID of the overwritten user or role |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise
editMessage(messageID, content) → {Promise.<Message>}
Edit a message
- Overrides:
- 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>
editPermission(overwriteID, allow, deny, type, reasonopt) → {Promise.<PermissionOverwrite>}
Create a channel permission overwrite
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
overwriteID |
String
|
The ID of the overwritten user or role |
|
allow |
BigInt
|
Number
|
String
|
The permissions number for allowed permissions |
|
deny |
BigInt
|
Number
|
String
|
The permissions number for denied permissions |
|
type |
Number
|
The object type of the overwrite, either 1 for "member" or 0 for "role" |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<PermissionOverwrite>
endPoll(messageID) → {Promise.<Message>}
Immediately end a poll. Note: You cannot end polls from other users.
- Overrides:
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message that the poll is in |
Returns:
- Type:
-
Promise.<Message>
getArchivedThreads(type, optionsopt) → {Promise.<Object>}
Get all archived threads in this channel
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type |
String
|
The type of thread channel, either "public" or "private" |
|||||||||||||
options |
Object
|
<optional> |
Additional options when requesting archived threads
|
Returns:
- Type:
-
Promise.<Object>
An object containing an array of threads, an array of members and whether the response hasMore threads that could be returned in a subsequent call
getInvites() → {Promise.<Array.<Invite>>}
Get all invites in the channel
- Source:
Returns:
- Type:
-
Promise.<Array.<Invite>>
getJoinedPrivateArchivedThreads(optionsopt) → {Promise.<Object>}
Get joined private archived threads in this channel
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
Additional options when requesting archived threads
|
Returns:
- Type:
-
Promise.<Object>
An object containing an array of threads, an array of members and whether the response hasMore threads that could be returned in a subsequent call
getMessage(messageID) → {Promise.<Message>}
Get a previous message in the channel
- Overrides:
- 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
- Overrides:
- 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
- Overrides:
- 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}>}>
getPollAnswerVoters(messageID, answerID, optionsopt) → {Promise.<Array.<User>>}
Get a list of users that voted for a specific poll answer
- Overrides:
- 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
|
pinMessage(messageID) → {Promise}
Pin a message
- 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
- Overrides:
- 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
- Overrides:
- 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
- Overrides:
- 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
- Overrides:
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
Returns:
- Type:
-
Promise
sendTyping() → {Promise}
Send typing status in the channel
- Overrides:
- 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
- Overrides:
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
The ID of the message |
Returns:
- Type:
-
Promise