Create a new Channel Method handler
Usually SnowTransfer creates a method handler for you, this is here for completion
You can access the methods listed via client.channel.method
, where client
is an initialized SnowTransfer instance
request handler that calls the rest api
Disable [at]everyone/[at]here on outgoing messages
Pin a message within a channel
Id of the channel
Id of the message
Reason for pinning the message
Resolves the Promise on successful execution
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | if channel is not a DM channel |
READ_MESSAGE_HISTORY | if channel is not a DM channel |
MANAGE_MESSAGES | if channel is not a DM channel |
Add a user to a thread
CurrentUser must be a member of the thread
Id of the thread
Id of the user to add
Resolves the Promise on successful execution
Permissions needed | Condition |
---|---|
CurrentUser added to Thread | always |
SEND_MESSAGES_IN_THREADS | always |
Bulk delete messages from a guild channel, messages may not be older than 2 weeks
Id of the guild channel
array of message ids to delete
Reason for deleting the messages
Resolves the Promise on successful execution
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | always |
MANAGE_MESSAGES | always |
Create an invite for a guild channel
If no data argument is passed, the invite will be created with the defaults
Id of the channel
invite data (optional)
(https://discord.com/developers/docs/resources/invite#invite-object) (with metadata)
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | always |
CREATE_INSTANT_INVITE | always |
Creates a new Message within a channel or thread
Make sure to use a filename with a proper extension (e.g. png, jpeg, etc.) when you want to upload files
Id of the Channel or thread to sent a message to
Data to send, if data is a string it will be used as the content of the message, if data is not a string you should take a look at the properties below to know what you may send
(https://discord.com/developers/docs/resources/channel#message-object) object
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | if channel is not a DM channel |
READ_MESSAGE_HISTORY | if channel is not a DM channel and message is a reply |
SEND_MESSAGES | if channel is not a DM channel and if channel is not a thread |
SEND_TTS_MESSAGES | if channel is not a DM channel and tts is set to true |
SEND_MESSAGES_IN_THREADS | if channel is a thread |
Adds a reaction to a message
Id of the channel
Id of the message
uri encoded reaction emoji to add
you may either use a discord emoji in the format :emoji_name:emoji_id
or a unicode emoji,
which can be found here
Resolves the Promise on successful execution
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | if channel is not a DM channel |
READ_MESSAGE_HISTORY | if channel is not a DM channel |
ADD_REACTIONS | When no other user has reacted with the emoji used and channel is not a DM channel |
Creates a public thread off a message in a guild channel
Id of the guild channel
Id of the message
Thread meta data
(https://discord.com/developers/docs/resources/channel#channel-object) object
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | always |
CREATE_PUBLIC_THREADS | always |
Creates a thread under a guild channel without a message
Id of the guild channel
Thread meta data
(https://discord.com/developers/docs/resources/channel#channel-object) object
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | always |
CREATE_PUBLIC_THREADS | if creating a public thread |
CREATE_PRIVATE_THREADS | if creating a private thread |
Crosspost a message in a news channel to all following channels
Id of the news channel
Id of the message
(https://discord.com/developers/docs/resources/channel#message-object) object
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | always |
SEND_MESSAGES | if the message was sent by the current user |
MANAGE_MESSAGES | if the message wasn't sent by the current user |
Delete all reactions from a message in a guild channel
Id of the guild channel
Id of the message
Resolves the Promise on successful execution
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | always |
READ_MESSAGE_HISTORY | always |
MANAGE_MESSAGES | always |
Delete a channel or thread via Id
This either deletes a Guild Channel/thread or closes a Direct Message Channel
Be careful with deleting Guild Channels as this cannot be undone!
When deleting a category, this does not delete the child channels of a category. They will just have their parent_id
removed.
For community guilds, the rules channel and the community updates channel cannot be deleted.
Id of the channel
Reason for deleting the channel
(https://discord.com/developers/docs/resources/channel#channel-object) object
Permissions needed | Condition |
---|---|
MANAGE_CHANNELS | if channel is not a DM channel |
MANAGE_THREADS | if channel is a thread |
Delete a permission overwrite from a guild channel
Id of the guild channel
Id of the permission overwrite
Reason for deleting the permission
Resolves the Promise on successful execution
Permissions needed | Condition |
---|---|
MANAGE_CHANNELS | if channel is not a thread |
MANAGE_THREADS | if channel is a thread |
MANAGE_ROLES | always |
VIEW_CHANNEL | always |
Delete a message
Id of the channel
Id of the message
Reason for deleting the message
Resolves the Promise on successful execution
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | if channel is not a DM channel |
MANAGE_MESSAGES | When the bot isn't the author of the message |
Delete a reaction from a message in a guild channel
Id of the guild channel
Id of the message
reaction emoji
Id of the user
Resolves the Promise on successful execution
Permission | Condition |
---|---|
MANAGE_MESSAGES | always |
VIEW_CHANNEL | always |
READ_MESSAGE_HISTORY | always |
Delete a reaction added by the current user from a message
Id of the channel
Id of the message
reaction emoji
Resolves the Promise on successful execution
Permission | Condition |
---|---|
VIEW_CHANNEL | if channel is not a DM channel |
READ_MESSAGE_HISTORY | if channel is not a DM channel |
Modify the permission overwrites of a guild channel
Id of the guild channel
Id of the permission overwrite
modified permission overwrite object
Resolves the Promise on successful execution
Permissions needed | Condition |
---|---|
MANAGE_CHANNELS | if channel is not a thread |
MANAGE_THREADS | if channel is a thread |
MANAGE_ROLES | always |
VIEW_CHANNEL | always |
Edit a message sent by the current user or edit the message flags of another user's message
Id of the channel
Id of the message
Data to send
(https://discord.com/developers/docs/resources/channel#message-object) object
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | if channel is not a DM channel |
MANAGE_MESSAGES | When editing someone else's message to set flags |
Follow a news channel to another channel
The Id of the news channel
The Id of the channel messages will be sent to
A followed channel object
Permissions needed | Condition |
---|---|
MANAGE_WEBHOOKS | always |
Get a channel via Id
Id of the channel
Gets all threads that are private and archived within a guild channel
CurrentUser must be a member of the thread if they do not have MANAGE_THREADS permissions
Id of the Channel
Object containing private threads, thread members of the CurrentUser, and if there are more results in the pagination
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | always |
READ_MESSAGE_HISTORY | always |
MANAGE_THREADS | if CurrentUser isn't added to Thread |
Gets all threads that are private and archived within a guild channel that the CurrentUser is apart of
CurrentUser must be a member of the thread if they do not have MANAGE_THREADS permissions
Id of the Channel
Object containing private threads, thread members of the CurrentUser, and if there are more results in the pagination
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | always |
Gets all threads that are public and archived within a guild channel
Id of the guild channel
Object containing public threads, thread members of the CurrentUser, and if there are more results in the pagination
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | always |
READ_MESSAGE_HISTORY | always |
Get a list of invites for a guild channel
Id of the guild channel
Array of invite objects (with metadata)
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | always |
MANAGE_CHANNELS | always |
Get a single message via Id
Id of the channel
Id of the message
(https://discord.com/developers/docs/resources/channel#message-object) object
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | if channel is not a DM channel |
READ_MESSAGE_HISTORY | if channel is not a DM channel |
Get a list of messages from a channel
Id of the channel
Array of discord message objects
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | if channel is not a DM channel |
READ_MESSAGE_HISTORY | if channel is not a DM channel, unless you want the API to return an empty Array |
Get a list of pinned messages for a channel
Id of the channel
Array of message objects
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | if channel is not a DM channel |
READ_MESSAGE_HISTORY | if channel is not a DM channel |
Get a list of users that reacted with a certain emoji on a certain message
Id of the channel
Id of the message
reaction emoji
Options for getting users
Array of user objects
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | if channel is not a DM channel |
READ_MESSAGE_HISTORY | if channel is not a DM channel |
Gets a member of a thread
Id of the thread
Id of the user
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | always |
Gets all members within a thread
Id of the Thread
Join a thread
Id of the thread
Resolves the Promise on successful execution
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | always |
Leave a thread
Id of the thread
Resolves the Promise on successful execution
Remove a pinned message from a channel
Id of the channel
Id of the message
Reason for removing the pinned message
Resolves the Promise on successful execution
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | if channel is not a DM channel |
READ_MESSAGE_HISTORY | if channel is not a DM channel |
MANAGE_MESSAGES | if channel is not a DM channel |
Remove a user from a thread
Id of the thread
Id of the user to remove
Resolves the Promise on successful execution
Permissions needed | Condition |
---|---|
MANAGE_THREADS | if the current user is not the creator of the thread |
Send an indicator that the current user is typing within a channel.
You should generally avoid this method unless used for longer computations (>1s)
Id of the channel
Resolves the Promise on successful execution
Permissions needed | Condition |
---|---|
VIEW_CHANNEL | if channel is not a DM channel |
SEND_MESSAGES | if channel is not a thread |
SEND_MESSAGES_IN_THREADS | if channel is a thread |
Update a guild channel or thread
Id of the guild channel
Data to send
(https://discord.com/developers/docs/resources/channel#channel-object) object
Permissions needed | Condition |
---|---|
MANAGE_CHANNELS | always |
MANAGE_ROLES | If modifying permission overwrites |
SEND_MESSAGES | When editing a Thread to change the name, archived, auto_archive_duration, rate_limit_per_user or locked fields |
MANAGE_THREADS | When editing a Thread and not modifying the name, archived, auto_archive_duration, rate_limit_per_user or locked fields |
Generated using TypeDoc
Methods for interacting with Channels and Messages