new TextChannel()
- Source:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
rateLimitPerUser |
Number | Amount of seconds a user has to wait before sending another message (0-120); bots, as well as users with the permission |
|
topic |
String |
<nullable> |
The topic of the text channel. |
lastMessageID |
Snowflake |
<nullable> |
The id of the last message sent |
mention |
String | The mention for the channel |
|
messages |
Store |
<nullable> |
The messages of the channel stored in the cache. |
parentID |
Snowflake |
<nullable> |
The id of the category the channel is in |
parent |
Object |
<nullable> |
The category the channel is in |
Extends
Methods
changePermissions(userOrRole, optionsopt) → {Promise.<(Member|Role)>}
- Source:
- Inherited From:
Edits the channel permission for the user or role
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userOrRole |
Snowflake | The id of the user or role |
|||||||||||||||||
options |
Object |
<optional> |
Options for the permission change Properties
|
Returns:
close() → {Promise.<(TextChannel|VoiceChannel|CategoryChannell)>}
- Source:
- Inherited From:
Closes a channel
Returns:
- Type
- Promise.<(TextChannel|VoiceChannel|CategoryChannell)>
createEmbed(embed) → {Promise.<Message>}
- Source:
- Deprecated:
- Use TextChannel#send() instead
Creates an embed to the channel
Parameters:
Name | Type | Description |
---|---|---|
embed |
Object | The embed to send |
Returns:
- Type
- Promise.<Message>
createInvite(optionsopt) → {Promise.<Invite>}
- Source:
- Inherited From:
Creates an invite for the guild channel
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Options for creating the invite Properties
|
Returns:
- Type
- Promise.<Invite>
createMessage(content) → {Promise.<Message>}
- Source:
- Deprecated:
- Use TextChannel#send() instead
Creates a message to the channel
Parameters:
Name | Type | Description |
---|---|---|
content |
String | The content of the message |
Returns:
- Type
- Promise.<Message>
(async) createReaction(message, emoji) → {Promise.<Message>}
- Source:
Add a reaction to a message
Parameters:
Name | Type | Description |
---|---|---|
message |
Snowflake | The id of the message to add a reaction to |
emoji |
String | The unicode of the emoji or for custom emojis, use
|
Returns:
- Type
- Promise.<Message>
delete() → {Promise.<(TextChannel|VoiceChannel|CategoryChannell)>}
- Source:
- Inherited From:
Similar to GuildChannel#delete
.
Closes a channel
Returns:
- Type
- Promise.<(TextChannel|VoiceChannel|CategoryChannell)>
edit(nameopt, positionopt) → {Promise.<(TextChannel|VoiceChannel|CategoryChannel)>}
- Source:
- Inherited From:
Edits the channel
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
String |
<optional> |
The new name of the channel |
position |
Number |
<optional> |
The new position of the channel |
Returns:
- Type
- Promise.<(TextChannel|VoiceChannel|CategoryChannel)>
getInvites() → {Promise.<Array.<Invite>>}
- Source:
- Inherited From:
Returns an array of Channel Invites
Returns:
- Type
- Promise.<Array.<Invite>>
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
|
Returns:
- Type
- Promise.<Array.<Message>>
getPinnedMessages() → {Promise.<Array.<Message>>}
- Source:
Fetches all the pinned messages in the channel
Returns:
- Type
- Promise.<Array.<Message>>
getReactions(message, emoji, optionsopt) → {Promise.<Array.<User>>}
- Source:
Get a list of users that reacted with the given emoji
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
Snowflake | The id of the message that has the reactions |
|
emoji |
String | The emoji that the users reacted to |
|
options |
Object |
<optional> |
options for the fetch |
Returns:
- Type
- Promise.<Array.<User>>
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
|
Returns:
- Type
- Promise.<Message>
permissionsFor(memberID, permissionName) → {Boolean}
- Source:
- Inherited From:
Checks a certain permission for a member in a Guild Channel
- This function is still in testing and might not work. ( Small Chance of not working )
Parameters:
Name | Type | Description |
---|---|---|
memberID |
Snowlake | The id of the member |
permissionName |
String | The name of the permission to check |
Returns:
- Type
- Boolean
removeAllReactions(message) → {Promise.<Message>}
- Source:
Removes all reactions from the message
Parameters:
Name | Type | Description |
---|---|---|
message |
Snowflake | The id of the message you will remove all reactions from |
Returns:
- Type
- Promise.<Message>
removeMessage(message, timeout) → {Void}
- Source:
Deletes a single message
Parameters:
Name | Type | Default | Description |
---|---|---|---|
message |
Snowflake | The id of the message deleted |
|
timeout |
Number |
0
|
The amount of time to wait before deleting the message in ms |
Returns:
Would return "{ deleted: true }" if it got deleted
- Type
- Void
(async) removeMessages(limitopt)
- Source:
Delete multiple messages in the channel
- Minimum messages to delete:
1
, Maximum:100
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
limit |
Number |
<optional> |
50
|
The amount of messages to delete |
(async) removeReaction(message, emoji) → {Promise.<Message>}
- Source:
Deletes a reaction from a message
Parameters:
Name | Type | Description |
---|---|---|
message |
Snowflake | The id of the message to remove a reaction from |
emoji |
String | The unicode of the emoji or for custom emojis, use
|
Returns:
- Type
- Promise.<Message>
(async) removeUserReaction(user, message, emoji) → {Promise.<Message>}
- Source:
Deletes a user's reaction from a message
Parameters:
Name | Type | Description |
---|---|---|
user |
Snowflake | The id of the user that added the reaction |
message |
Snowflake | The id of the message to remove a reaction from |
emoji |
String | The unicode of the emoji or for custom emojis, use
|
Returns:
- Type
- Promise.<Message>
send(options) → {Promise.<Message>}
- Source:
Sends a message to the channel
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Returns:
- Type
- Promise.<Message>