class ChannelsAPI

export declare class ChannelsAPI

Constructors

constructor(
rest: REST
)

Constructs a new instance of the ChannelsAPI class

addMessageReaction(
channelId: Snowflake
messageId: Snowflake
emoji: string
options?: Pick<RequestData, 'signal'>
) : Promise<void>

Adds a reaction to a message

See also: https://discord.com/developers/docs/resources/channel#create-reaction

bulkDeleteMessages(
channelId: Snowflake
messageIds: Snowflake[]
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Bulk deletes messages

See also: https://discord.com/developers/docs/resources/channel#bulk-delete-messages

createInvite(
channelId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APIExtendedInvite>

Creates a new invite for a channel

See also: https://discord.com/developers/docs/resources/channel#create-channel-invite

createMessage(
channelId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIMessage>

Sends a message in a channel

See also: https://discord.com/developers/docs/resources/channel#create-message

crosspostMessage(
channelId: Snowflake
messageId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIMessage>

Crossposts a message

See also: https://discord.com/developers/docs/resources/channel#crosspost-message

deleteAllMessageReactions(
channelId: Snowflake
messageId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<void>

Deletes all reactions for a message

See also: https://discord.com/developers/docs/resources/channel#delete-all-reactions

deleteAllMessageReactionsForEmoji(
channelId: Snowflake
messageId: Snowflake
emoji: string
options?: Pick<RequestData, 'signal'>
) : Promise<void>

Deletes all reactions of an emoji for a message

See also: https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji

deleteMessage(
channelId: Snowflake
messageId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Deletes a message

See also: https://discord.com/developers/docs/resources/channel#delete-message

deleteOwnMessageReaction(
channelId: Snowflake
messageId: Snowflake
emoji: string
options?: Pick<RequestData, 'signal'>
) : Promise<void>

Deletes a reaction for the current user

See also: https://discord.com/developers/docs/resources/channel#delete-own-reaction

deleteUserMessageReaction(
channelId: Snowflake
messageId: Snowflake
emoji: string
userId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<void>

Deletes a reaction for a user

See also: https://discord.com/developers/docs/resources/channel#delete-user-reaction

editMessage(
channelId: Snowflake
messageId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIMessage>

Edits a message

See also: https://discord.com/developers/docs/resources/channel#edit-message

followAnnouncements(
channelId: Snowflake
webhookChannelId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIFollowedChannel>

Follows an announcement channel

See also: https://discord.com/developers/docs/resources/channel#follow-announcement-channel

get(
channelId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIChannel>

Fetches a channel

See also: https://discord.com/developers/docs/resources/channel#get-channel

getInvites(
channelId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPIChannelInvitesResult>

Fetches the invites of a channel

See also: https://discord.com/developers/docs/resources/channel#get-channel-invites

getJoinedPrivateArchivedThreads(
channelId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPIChannelUsersThreadsArchivedResult>

Fetches the private joined archived threads of a channel

See also: https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads

getMessage(
channelId: Snowflake
messageId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIMessage>

Fetches a message

See also: https://discord.com/developers/docs/resources/channel#get-channel-message

getPins(
channelId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPIChannelPinsResult>

Fetches the pinned messages of a channel

See also: https://discord.com/developers/docs/resources/channel#get-pinned-messages

pinMessage(
channelId: Snowflake
messageId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Pins a message in a channel

See also: https://discord.com/developers/docs/resources/channel#pin-message

showTyping(
channelId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<void>

Shows a typing indicator in a channel

See also: https://discord.com/developers/docs/resources/channel#trigger-typing-indicator

unpinMessage(
channelId: Snowflake
messageId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Unpins a message in a channel

See also: https://discord.com/developers/docs/resources/channel#unpin-message