export declare class ChannelsAPI export declare class ChannelsAPI No summary provided.
constructor(rest)
Constructs a new instance of the 
ChannelsAPI class| Name | Type | Optional | Description | 
|---|---|---|---|
| rest | REST | No | None | 
addMessageReaction(channelId, messageId, emoji, { signal }?)
:
Promise<void>
Adds a reaction to a message
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel the message is in | 
| messageId | Snowflake | No | The id of the message to add the reaction to | 
| emoji | string | No | The emoji to add the reaction with | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
bulkDeleteMessages(channelId, messageIds, { reason, signal }?)
:
Promise<void>
Bulk deletes messages
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel the messages are in | 
| messageIds | Snowflake[] | No | The ids of the messages to delete | 
| { reason, signal } | Pick<RequestData, 'reason' | 'signal'> | Yes | None | 
createInvite(channelId, body, { reason, signal }?)
:
Promise<APIExtendedInvite>
Creates a new invite for a channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to create an invite for | 
| body | RESTPostAPIChannelInviteJSONBody | No | The data to use when creating the invite | 
| { reason, signal } | Pick<RequestData, 'reason' | 'signal'> | Yes | None | 
createMessage(channelId, { files, ...body }, { signal }?)
:
Promise<APIMessage>
Sends a message in a channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to send the message in | 
| { files, ...body } | RESTPostAPIChannelMessageJSONBody & { files?: RawFile[]; } | No | None | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
crosspostMessage(channelId, messageId, { signal }?)
:
Promise<APIMessage>
Crossposts a message
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel the message is in | 
| messageId | Snowflake | No | The id of the message to crosspost | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
delete(channelId, { signal }?)
:
Promise<APIChannel>
Deletes a channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to delete | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
deleteAllMessageReactions(channelId, messageId, { signal }?)
:
Promise<void>
Deletes all reactions for a message
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel the message is in | 
| messageId | Snowflake | No | The id of the message to delete the reactions for | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
deleteAllMessageReactionsForEmoji(channelId, messageId, emoji, { signal }?)
:
Promise<void>
Deletes all reactions of an emoji for a message
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel the message is in | 
| messageId | Snowflake | No | The id of the message to delete the reactions for | 
| emoji | string | No | The emoji to delete the reactions for | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
deleteMessage(channelId, messageId, { reason, signal }?)
:
Promise<void>
Deletes a message
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel the message is in | 
| messageId | Snowflake | No | The id of the message to delete | 
| { reason, signal } | Pick<RequestData, 'reason' | 'signal'> | Yes | None | 
deleteOwnMessageReaction(channelId, messageId, emoji, { signal }?)
:
Promise<void>
Deletes a reaction for the current user
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel the message is in | 
| messageId | Snowflake | No | The id of the message to delete the reaction for | 
| emoji | string | No | The emoji to delete the reaction for | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
deleteUserMessageReaction(channelId, messageId, emoji, userId, { signal }?)
:
Promise<void>
Deletes a reaction for a user
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel the message is in | 
| messageId | Snowflake | No | The id of the message to delete the reaction for | 
| emoji | string | No | The emoji to delete the reaction for | 
| userId | Snowflake | No | The id of the user to delete the reaction for | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
edit(channelId, body, { signal }?)
:
Promise<APIChannel>
Edits a channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to edit | 
| body | RESTPatchAPIChannelJSONBody | No | The new channel data | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
editMessage(channelId, messageId, { files, ...body }, { signal }?)
:
Promise<APIMessage>
Edits a message
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel the message is in | 
| messageId | Snowflake | No | The id of the message to edit | 
| { files, ...body } | RESTPatchAPIChannelMessageJSONBody & { files?: RawFile[]; } | No | None | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
followAnnouncements(channelId, webhookChannelId, { signal }?)
:
Promise<APIFollowedChannel>
Follows an announcement channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the announcement channel to follow | 
| webhookChannelId | Snowflake | No | The id of the webhook channel to follow the announcements in | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
get(channelId, { signal }?)
:
Promise<APIChannel>
Fetches a channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
getArchivedThreads(channelId, archivedStatus, query?, { signal }?)
:
Promise<RESTGetAPIChannelUsersThreadsArchivedResult>
Fetches the archived threads of a channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to fetch archived threads from | 
| archivedStatus | 'private' | 'public' | No | The archived status of the threads to fetch | 
| query | RESTGetAPIChannelThreadsArchivedQuery | Yes | The options to use when fetching archived threads | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
getInvites(channelId, { signal }?)
:
Promise<RESTGetAPIChannelInvitesResult>
Fetches the invites of a channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to fetch invites from | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
getJoinedPrivateArchivedThreads(channelId, query?, { signal }?)
:
Promise<RESTGetAPIChannelUsersThreadsArchivedResult>
Fetches the private joined archived threads of a channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to fetch joined archived threads from | 
| query | RESTGetAPIChannelThreadsArchivedQuery | Yes | The options to use when fetching joined archived threads | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
getMessage(channelId, messageId, { signal }?)
:
Promise<APIMessage>
Fetches a message
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel the message is in | 
| messageId | Snowflake | No | The id of the message to fetch | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
getMessageReactions(channelId, messageId, emoji, query?, { signal }?)
:
Promise<RESTGetAPIChannelMessageReactionUsersResult>
Fetches the reactions for a message
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel the message is in | 
| messageId | Snowflake | No | The id of the message to get the reactions for | 
| emoji | string | No | The emoji to get the reactions for | 
| query | RESTGetAPIChannelMessageReactionUsersQuery | Yes | The query options to use when fetching the reactions | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
getMessages(channelId, query?, { signal }?)
:
Promise<RESTGetAPIChannelMessagesResult>
Fetches the messages of a channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to fetch messages from | 
| query | RESTGetAPIChannelMessagesQuery | Yes | The query options to use when fetching messages | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
getPins(channelId, { signal }?)
:
Promise<RESTGetAPIChannelPinsResult>
Fetches the pinned messages of a channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to fetch pinned messages from | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
getWebhooks(id)
:
Promise<RESTGetAPIChannelWebhooksResult>
Fetches the webhooks of a channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| id | Snowflake | No | The id of the channel | 
pinMessage(channelId, messageId, { reason, signal }?)
:
Promise<void>
Pins a message in a channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to pin the message in | 
| messageId | Snowflake | No | The id of the message to pin | 
| { reason, signal } | Pick<RequestData, 'reason' | 'signal'> | Yes | None | 
showTyping(channelId, { signal }?)
:
Promise<void>
Shows a typing indicator in a channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to show the typing indicator in | 
| { signal } | Pick<RequestData, 'signal'> | Yes | None | 
unpinMessage(channelId, messageId, { reason, signal }?)
:
Promise<void>
Unpins a message in a channel
| Name | Type | Optional | Description | 
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to unpin the message in | 
| messageId | Snowflake | No | The id of the message to unpin | 
| { reason, signal } | Pick<RequestData, 'reason' | 'signal'> | Yes | None |