export declare class ChannelsAPI
export declare class ChannelsAPI
No summary provided.
constructor(rest)
Constructs a new instance of the
ChannelsAPI
className | Type | Optional | Description |
---|---|---|---|
rest | REST | No | None |
addMessageReaction(channelId, messageId, emoji)
:
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 |
bulkDeleteMessages(channelId, messageIds, reason?)
:
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 | string | Yes | None |
createInvite(channelId, data, reason?)
:
Promise<import("discord-api-types/v10").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 |
data | RESTPostAPIChannelInviteJSONBody | No | The data to use when creating the invite |
reason | string | Yes | None |
createMessage(channelId, { files, ...body })
:
Promise<import("discord-api-types/v10").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 |
crosspostMessage(channelId, messageId)
:
Promise<import("discord-api-types/v10").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 |
delete(channelId)
:
Promise<import("discord-api-types/v10").APIChannel>
Deletes a channel
Name | Type | Optional | Description |
---|---|---|---|
channelId | Snowflake | No | The id of the channel to delete |
deleteAllMessageReactions(channelId, messageId)
:
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 |
deleteAllMessageReactionsForEmoji(channelId, messageId, emoji)
:
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 |
deleteMessage(channelId, messageId, reason?)
:
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 | string | Yes | The reason for deleting the message |
deleteOwnMessageReaction(channelId, messageId, emoji)
:
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 |
deleteUserMessageReaction(channelId, messageId, emoji, userId)
:
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 |
edit(channelId, data)
:
Promise<import("discord-api-types/v10").APIChannel>
Edits a channel
Name | Type | Optional | Description |
---|---|---|---|
channelId | Snowflake | No | The id of the channel to edit |
data | RESTPatchAPIChannelJSONBody | No | The new channel data |
editMessage(channelId, messageId, { files, ...body })
:
Promise<import("discord-api-types/v10").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 } | RESTPostAPIChannelMessageJSONBody & { files?: RawFile[]; } | No | None |
followAnnouncements(channelId, webhookChannelId)
:
Promise<import("discord-api-types/v10").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 |
get(channelId)
:
Promise<import("discord-api-types/v10").APIChannel>
Fetches a channel
Name | Type | Optional | Description |
---|---|---|---|
channelId | Snowflake | No | The id of the channel |
getArchivedThreads(channelId, archivedStatus, options?)
:
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 |
options | RESTGetAPIChannelThreadsArchivedQuery | Yes | The options to use when fetching archived threads |
getInvites(channelId)
:
Promise<RESTGetAPIChannelInvitesResult>
Fetches the invites of a channel
Name | Type | Optional | Description |
---|---|---|---|
channelId | Snowflake | No | The id of the channel to fetch invites from |
getJoinedPrivateArchivedThreads(channelId, options?)
:
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 |
options | RESTGetAPIChannelThreadsArchivedQuery | Yes | The options to use when fetching joined archived threads |
getMessage(channelId, messageId)
:
Promise<import("discord-api-types/v10").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 |
getMessageReactions(channelId, messageId, emoji, options?)
:
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 |
options | RESTGetAPIChannelMessageReactionUsersQuery | Yes | The options to use when fetching the reactions |
getMessages(channelId, options?)
:
Promise<RESTGetAPIChannelMessagesResult>
Fetches the messages of a channel
Name | Type | Optional | Description |
---|---|---|---|
channelId | Snowflake | No | The id of the channel to fetch messages from |
options | RESTGetAPIChannelMessagesQuery | Yes | The options to use when fetching messages |
getPins(channelId)
:
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 |
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?)
:
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 | string | Yes | The reason for pinning the message |
showTyping(channelId)
:
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 |
unpinMessage(channelId, messageId, reason?)
:
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 | string | Yes | The reason for unpinning the message |