Skip to content
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

Thread documentation updates #3502

Merged
merged 4 commits into from
Jul 29, 2021
Merged

Thread documentation updates #3502

merged 4 commits into from
Jul 29, 2021

Conversation

ajpalkovic
Copy link
Contributor

Closes #3494
Closes #3458
Closes #3486

@@ -35,7 +35,7 @@ Represents a guild or DM channel within Discord.
| default_auto_archive_duration? | integer | default duration for newly created threads, in minutes, to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 |
| permissions? | string | computed permissions for the invoking user in the channel, including overwrites, only included when part of the `resolved` data received on a slash command interaction |

\* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
\* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval. For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value. The abscene of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
Copy link
Contributor

Choose a reason for hiding this comment

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

If this note is for #3486 then isn't this just for creation and receiving the actual data? It was my understanding that the issue was regarding thread updates not sending the field if it had changed from non-default -> default value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that was the intention, really all I did was change our clients to channel.rateLimitPerUser = update.rateLimitPerUser ?? 0 which seemed pretty reasonable I guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Rapptz are you asking for the field to always be included in dispatches like thread_update?

|----------|---------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| threads | array of [channel](#DOCS_RESOURCES_CHANNEL/channel-object) objects | the active threads |
| members | array of [thread members](#DOCS_RESOURCES_CHANNEL/thread-member-object) objects | a thread member object for each returned thread the current user has joined |

Copy link
Contributor

Choose a reason for hiding this comment

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

What is with
| has_more | boolean | whether there are potentially additional threads that could be returned on a subsequent call |

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it was removed, it was confusing because it was always true
And we don't have an efficient way of paginating here and it's pretty cheap to just return everything since there is an active thread cap

Copy link
Contributor

Choose a reason for hiding this comment

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

That means we get every thread till the cap?

Copy link
Contributor

Choose a reason for hiding this comment

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

What is the internal cap?
I'm interested. Would like to set a note in the docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I replied to this in DDevs a couple of times search for "1k" from me there. No plans to document the limit, since it's certainly possible it could change early on.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oky doki.
Thanks.

docs/resources/Channel.md Outdated Show resolved Hide resolved
Copy link
Contributor

@Lulalaby Lulalaby left a comment

Choose a reason for hiding this comment

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

Good :3

| removed_member_ids? | array of snowflakes | the id of the users who were removed from the thread |

\* In this gateway event, the thread member objects will also include the [guild member](#DOCS_RESOURCES_GUILD/guild-member-object) and [presence](#DOCS_TOPICS_GATEWAY/presence) objects for each added thread member.
Copy link
Contributor

Choose a reason for hiding this comment

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

The json key is "member" and "presence", right?

Copy link
Contributor

Choose a reason for hiding this comment

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

This should be documented in the Thread Member structure as optional fields, as well.

@ajpalkovic ajpalkovic merged commit c9c1dc8 into master Jul 29, 2021
@ajpalkovic ajpalkovic deleted the thread-updates branch July 29, 2021 23:15
Nihlus added a commit to Remora/Remora.Discord that referenced this pull request Jul 30, 2021
See discord/discord-api-docs#3502, as well as
discord/discord-api-docs#3526. The latter PR has not yet been merged,
but it is preemptively required to fully support the implementations
from this commit.
arqunis pushed a commit to serenity-rs/serenity that referenced this pull request Sep 5, 2021
This commit adds support to the GET guild active threads endpoint, as per discord/discord-api-docs#3502. 
It also deprecates the methods for the GET channel active threads endpoint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants