diff --git a/packages/core/src/api/channel.ts b/packages/core/src/api/channel.ts index 9f038d0f3..a25f948e3 100644 --- a/packages/core/src/api/channel.ts +++ b/packages/core/src/api/channel.ts @@ -10,9 +10,10 @@ import { type RESTGetAPIChannelMessageReactionUsersQuery, type RESTGetAPIChannelMessageReactionUsersResult, type RESTGetAPIChannelMessageResult, + type RESTGetAPIChannelMessagesPinsQuery, + type RESTGetAPIChannelMessagesPinsResult, type RESTGetAPIChannelMessagesQuery, type RESTGetAPIChannelMessagesResult, - type RESTGetAPIChannelPinsResult, type RESTGetAPIChannelResult, type RESTGetAPIChannelThreadsArchivedQuery, type RESTGetAPIChannelUsersThreadsArchivedResult, @@ -340,20 +341,29 @@ export class ChannelsAPI { } /** - * Fetches the pinned messages of a channel + * Fetches pinned messages of a channel * - * @see {@link https://discord.com/developers/docs/resources/channel#get-pinned-messages} + * @see {@link https://discord.com/developers/docs/resources/message#get-channel-pins} * @param channelId - The id of the channel to fetch pinned messages from - * @param options - The options for fetching the pinned messages + * @param query - The query options for fetching pinned messages + * @param options - The options for fetching pinned messages */ - public async getPins(channelId: Snowflake, { auth, signal }: Pick = {}) { - return this.rest.get(Routes.channelPins(channelId), { auth, signal }) as Promise; + public async getPins( + channelId: Snowflake, + query: RESTGetAPIChannelMessagesPinsQuery = {}, + { auth, signal }: Pick = {}, + ) { + return this.rest.get(Routes.channelMessagesPins(channelId), { + auth, + query: makeURLSearchParams(query), + signal, + }) as Promise; } /** * Pins a message in a channel * - * @see {@link https://discord.com/developers/docs/resources/channel#pin-message} + * @see {@link https://discord.com/developers/docs/resources/message#pin-message} * @param channelId - The id of the channel to pin the message in * @param messageId - The id of the message to pin * @param options - The options for pinning the message @@ -363,7 +373,7 @@ export class ChannelsAPI { messageId: Snowflake, { auth, reason, signal }: Pick = {}, ) { - await this.rest.put(Routes.channelPin(channelId, messageId), { auth, reason, signal }); + await this.rest.put(Routes.channelMessagesPin(channelId, messageId), { auth, reason, signal }); } /** @@ -439,7 +449,7 @@ export class ChannelsAPI { /** * Unpins a message in a channel * - * @see {@link https://discord.com/developers/docs/resources/channel#unpin-message} + * @see {@link https://discord.com/developers/docs/resources/message#unpin-message} * @param channelId - The id of the channel to unpin the message in * @param messageId - The id of the message to unpin * @param options - The options for unpinning the message @@ -449,7 +459,7 @@ export class ChannelsAPI { messageId: Snowflake, { auth, reason, signal }: Pick = {}, ) { - await this.rest.delete(Routes.channelPin(channelId, messageId), { auth, reason, signal }); + await this.rest.delete(Routes.channelMessagesPin(channelId, messageId), { auth, reason, signal }); } /**