You are reading the documentation for the next version of discord.js. Documentation for v13/v14+ has been moved to old.discordjs.dev

ChannelsAPI

export declare class ChannelsAPI
export declare class ChannelsAPI

No summary provided.

constructor(rest)
Constructs a new instance of the ChannelsAPI class
NameTypeOptionalDescription
restRESTNoNone
addMessageReaction(channelId, messageId, emoji, options?):Promise<void>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to add the reaction to
emojistringNoThe emoji to add the reaction with
optionsPick<RequestData, 'signal'>YesThe options for adding the reaction
bulkDeleteMessages(channelId, messageIds, options?):Promise<void>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the messages are in
messageIdsSnowflake[]NoThe ids of the messages to delete
optionsPick<RequestData, 'reason' | 'signal'>YesThe options for deleting the messages
createInvite(channelId, body, options?):Promise<APIExtendedInvite>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to create an invite for
bodyRESTPostAPIChannelInviteJSONBodyNoThe data to use when creating the invite
optionsPick<RequestData, 'reason' | 'signal'>YesThe options for creating the invite
createMessage(channelId, body, options?):Promise<APIMessage>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to send the message in
bodyRESTPostAPIChannelMessageJSONBody & { files?: RawFile[]; }NoThe data to use when sending the message
optionsPick<RequestData, 'signal'>YesThe options to use when sending the message
crosspostMessage(channelId, messageId, options?):Promise<APIMessage>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to crosspost
optionsPick<RequestData, 'signal'>YesThe options for crossposting the message
delete(channelId, options?):Promise<APIChannel>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to delete
optionsPick<RequestData, 'signal'>YesThe options for deleting the channel
deleteAllMessageReactions(channelId, messageId, options?):Promise<void>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to delete the reactions for
optionsPick<RequestData, 'signal'>YesThe options for deleting the reactions
deleteAllMessageReactionsForEmoji(channelId, messageId, emoji, options?):Promise<void>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to delete the reactions for
emojistringNoThe emoji to delete the reactions for
optionsPick<RequestData, 'signal'>YesThe options for deleting the reactions
deleteMessage(channelId, messageId, options?):Promise<void>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to delete
optionsPick<RequestData, 'reason' | 'signal'>YesThe options for deleting the message
deleteOwnMessageReaction(channelId, messageId, emoji, options?):Promise<void>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to delete the reaction for
emojistringNoThe emoji to delete the reaction for
optionsPick<RequestData, 'signal'>YesThe options for deleting the reaction
deleteUserMessageReaction(channelId, messageId, emoji, userId, options?):Promise<void>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to delete the reaction for
emojistringNoThe emoji to delete the reaction for
userIdSnowflakeNoThe id of the user to delete the reaction for
optionsPick<RequestData, 'signal'>YesThe options for deleting the reaction
edit(channelId, body, options?):Promise<APIChannel>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to edit
bodyRESTPatchAPIChannelJSONBodyNoThe new channel data
optionsPick<RequestData, 'signal'>YesThe options for editing the channel
editMessage(channelId, messageId, body, options?):Promise<APIMessage>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to edit
bodyRESTPatchAPIChannelMessageJSONBody & { files?: RawFile[]; }NoThe data to use when editing the message
optionsPick<RequestData, 'signal'>YesThe options to use when editing the message
followAnnouncements(channelId, webhookChannelId, options?):Promise<APIFollowedChannel>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the announcement channel to follow
webhookChannelIdSnowflakeNoThe id of the webhook channel to follow the announcements in
optionsPick<RequestData, 'signal'>YesThe options for following the announcement channel
get(channelId, options?):Promise<APIChannel>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel
optionsPick<RequestData, 'signal'>YesThe options for fetching the channel
getArchivedThreads(channelId, archivedStatus, query?, options?):Promise<RESTGetAPIChannelUsersThreadsArchivedResult>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to fetch archived threads from
archivedStatus'private' | 'public'NoThe archived status of the threads to fetch
queryRESTGetAPIChannelThreadsArchivedQueryYesThe options to use when fetching archived threads
optionsPick<RequestData, 'signal'>YesThe options for fetching archived threads
getInvites(channelId, options?):Promise<RESTGetAPIChannelInvitesResult>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to fetch invites from
optionsPick<RequestData, 'signal'>YesThe options for fetching the invites
getJoinedPrivateArchivedThreads(channelId, query?, options?):Promise<RESTGetAPIChannelUsersThreadsArchivedResult>
Fetches the private joined archived threads of a channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to fetch joined archived threads from
queryRESTGetAPIChannelThreadsArchivedQueryYesThe options to use when fetching joined archived threads
optionsPick<RequestData, 'signal'>YesThe options for fetching joined archived threads
getMessage(channelId, messageId, options?):Promise<APIMessage>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to fetch
optionsPick<RequestData, 'signal'>YesThe options for fetching the message
getMessageReactions(channelId, messageId, emoji, query?, options?):Promise<RESTGetAPIChannelMessageReactionUsersResult>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to get the reactions for
emojistringNoThe emoji to get the reactions for
queryRESTGetAPIChannelMessageReactionUsersQueryYesThe query options to use when fetching the reactions
optionsPick<RequestData, 'signal'>YesThe options for fetching the message reactions
getMessages(channelId, query?, options?):Promise<RESTGetAPIChannelMessagesResult>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to fetch messages from
queryRESTGetAPIChannelMessagesQueryYesThe query options to use when fetching messages
optionsPick<RequestData, 'signal'>YesThe options for fetching the messages
getPins(channelId, options?):Promise<RESTGetAPIChannelPinsResult>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to fetch pinned messages from
optionsPick<RequestData, 'signal'>YesThe options for fetching the pinned messages
getWebhooks(id):Promise<RESTGetAPIChannelWebhooksResult>
NameTypeOptionalDescription
idSnowflakeNoThe id of the channel
pinMessage(channelId, messageId, options?):Promise<void>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to pin the message in
messageIdSnowflakeNoThe id of the message to pin
optionsPick<RequestData, 'reason' | 'signal'>YesThe options for pinning the message
showTyping(channelId, options?):Promise<void>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to show the typing indicator in
optionsPick<RequestData, 'signal'>YesThe options for showing the typing indicator
unpinMessage(channelId, messageId, options?):Promise<void>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to unpin the message in
messageIdSnowflakeNoThe id of the message to unpin
optionsPick<RequestData, 'reason' | 'signal'>YesThe options for unpinning the message