ChannelsAPI

declare class ChannelsAPI
declare class ChannelsAPI

No summary provided.

constructor(rest)
Constructs a new instance of the ChannelsAPI class
NameTypeOptionalDescription
restRESTNoNone
addMessageReaction(channelId, messageId, emoji):Promise<void>
Adds a reaction to a message
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
bulkDeleteMessages(channelId, messageIds, reason?):Promise<void>
Bulk deletes messages
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the messages are in
messageIdsSnowflake[]NoThe ids of the messages to delete
reasonstringYesNone
createInvite(channelId, data, reason?):Promise<discord_api_types_v10.APIExtendedInvite>
Creates a new invite for a channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to create an invite for
dataRESTPostAPIChannelInviteJSONBodyNoThe data to use when creating the invite
reasonstringYesNone
createMessage(channelId, data):Promise<discord_api_types_v10.APIMessage>
Sends a message in a channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to send the message in
dataRESTPostAPIChannelMessageJSONBody & { files?: RawFile[]; }NoThe data to use when sending the message
crosspostMessage(channelId, messageId):Promise<discord_api_types_v10.APIMessage>
Crossposts a message
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to crosspost
Deletes a channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to delete
deleteAllMessageReactions(channelId, messageId):Promise<void>
Deletes all reactions for a message
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to delete the reactions for
deleteAllMessageReactionsForEmoji(channelId, messageId, emoji):Promise<void>
Deletes all reactions of an emoji for a message
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
deleteMessage(channelId, messageId, reason?):Promise<void>
Deletes a message
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to delete
reasonstringYesThe reason for deleting the message
deleteOwnMessageReaction(channelId, messageId, emoji):Promise<void>
Deletes a reaction for the current user
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
deleteUserMessageReaction(channelId, messageId, emoji, userId):Promise<void>
Deletes a reaction for a user
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
Edits a channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to edit
dataRESTPatchAPIChannelJSONBodyNoThe new channel data
editMessage(channelId, messageId, data):Promise<discord_api_types_v10.APIMessage>
Edits a message
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to edit
dataRESTPostAPIChannelMessageJSONBody & { files?: RawFile[]; }NoThe data to use when editing the message
followAnnouncements(channelId, webhookChannelId):Promise<discord_api_types_v10.APIFollowedChannel>
Follows an announcement channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the announcement channel to follow
webhookChannelIdSnowflakeNoThe id of the webhook channel to follow the announcements in
Fetches a channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel
getArchivedThreads(channelId, archivedStatus, options?):Promise<RESTGetAPIChannelUsersThreadsArchivedResult>
Fetches the archived threads of a channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to fetch archived threads from
archivedStatus'private' | 'public'NoThe archived status of the threads to fetch
optionsRESTGetAPIChannelThreadsArchivedQueryYesThe options to use when fetching archived threads
Fetches the invites of a channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to fetch invites from
getJoinedPrivateArchivedThreads(channelId, options?):Promise<RESTGetAPIChannelUsersThreadsArchivedResult>
Fetches the private joined archived threads of a channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to fetch joined archived threads from
optionsRESTGetAPIChannelThreadsArchivedQueryYesThe options to use when fetching joined archived threads
getMessage(channelId, messageId):Promise<discord_api_types_v10.APIMessage>
Fetches a message
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel the message is in
messageIdSnowflakeNoThe id of the message to fetch
getMessageReactions(channelId, messageId, emoji, options?):Promise<RESTGetAPIChannelMessageReactionUsersResult>
Fetches the reactions for a message
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
optionsRESTGetAPIChannelMessageReactionUsersQueryYesThe options to use when fetching the reactions
getMessages(channelId, options?):Promise<RESTGetAPIChannelMessagesResult>
Fetches the messages of a channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to fetch messages from
optionsRESTGetAPIChannelMessagesQueryYesThe options to use when fetching messages
Fetches the pinned messages of a channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to fetch pinned messages from
pinMessage(channelId, messageId, reason?):Promise<void>
Pins a message in a channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to pin the message in
messageIdSnowflakeNoThe id of the message to pin
reasonstringYesThe reason for pinning the message
showTyping(channelId):Promise<void>
Shows a typing indicator in a channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to show the typing indicator in
unpinMessage(channelId, messageId, reason?):Promise<void>
Unpins a message in a channel
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to unpin the message in
messageIdSnowflakeNoThe id of the message to unpin
reasonstringYesThe reason for unpinning the message