Skip to content

Document new pin endpoints #7585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 21, 2025
Merged

Document new pin endpoints #7585

merged 4 commits into from
Jun 21, 2025

Conversation

RedDaedalus
Copy link
Member

@RedDaedalus RedDaedalus commented May 31, 2025


@RedDaedalus RedDaedalus requested a review from a team as a code owner May 31, 2025 04:13
@RedDaedalus RedDaedalus requested review from anthonydiscord and removed request for a team May 31, 2025 04:13
<Route method="GET">/channels/[\{channel.id\}](/docs/resources/channel#channel-object)/pins</Route>

Gets the first 50 pinned messages in a channel, returning an array of [message](/docs/resources/message#message-object) objects on success.
This endpoint is deprecated. Use the one above instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "above" might be confusing since it's a bit far away. This is a website, so we can use hrefs to refer to another section.

Suggested change
This endpoint is deprecated. Use the one above instead.
This endpoint is deprecated. Use [Get Channel Pins](/docs/resources/message#get-channel-pins) instead.

I'd do the same for each deprecated endpoint.

| Field | Type | Description | Default |
|---------|-------------------|-------------------------------------------|---------|
| before? | ISO8601 timestamp | Get messages pinned before this timestamp | absent |
| limit? | integer | Max number of pins to return (1-50) | 50 |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| limit? | integer | Max number of pins to return (1-50) | 50 |
| limit? | integer | Max number of pins to return (2-50) | 50 |

Setting the limit to 1 throws the following:

400 Bad Request (error code: 50035): Invalid Form Body
In limit: int value should be greater than or equal to 2.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably better to support limits of 1 for consistency

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this I suggest submitting an issue since we would likely want the endpoint to be able to return one pin.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So... this pull request has merged immaturely?

Copy link

@Soheab Soheab Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: setting the limit to 1 works as it should now. I was calling a different endpoint, it still errors out when set to 1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I let the team know about the issue, thanks for digging into it!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, limit=1 works now

Soheab added a commit to Soheab/discord.py that referenced this pull request Jun 14, 2025
@anthonydiscord anthonydiscord merged commit 404b074 into main Jun 21, 2025
4 checks passed
@anthonydiscord anthonydiscord deleted the new-pins-endpoint branch June 21, 2025 01:27
mazylol pushed a commit to mazylol/discord-api-docs that referenced this pull request Jul 3, 2025
* document new pin endpoints

* fix errors

* fix tables

* Update links

---------

Co-authored-by: Anthony Tesija <anthony.tesija@discordapp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants