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

Support creating standalone public threads #2470

Merged
merged 2 commits into from
Jul 6, 2023

Conversation

fenhl
Copy link
Contributor

@fenhl fenhl commented Jun 22, 2023

Discord's API has two endpoints for creating threads: one for creating a thread as a reply to a message and one for creating a thread that's not connected to any existing message. The former only supports creating public threads, but the latter supports both public and private threads. However, serenity did not allow creating public standalone threads. This PR fills that gap, and renames the methods for calling these endpoints to more accurately describe what they do.

When I brought up the missing functionality in the #serenity channel, @arqunis claimed that the “start thread without message” endpoint was only for private threads, pointing to this part of the documentation:

* type currently defaults to PRIVATE_THREAD in order to match the behavior when thread documentation was first published. In a future API version this will be changed to be a required field, with no default.

I believe that this is a misunderstanding of the docs. They say “defaults to PRIVATE_THREAD”, not “must be PRIVATE_THREAD”. I also tested calling the endpoint manually with type set to PUBLIC_THREAD and it works as expected.

@github-actions github-actions bot added builder Related to the `builder` module. http Related to the `http` module. model Related to the `model` module. labels Jun 22, 2023
@fenhl
Copy link
Contributor Author

fenhl commented Jun 22, 2023

CI failure seems to be unrelated.

Copy link
Collaborator

@mkrasnitski mkrasnitski left a comment

Choose a reason for hiding this comment

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

Just a few minor things. I think mentioning that threads linked to messages will always be public is something we should do, so the docs change to the create_thread_from_message methods should be reverted. It might also be worth changing the docs on CreateThread::kind to mention how the field is ignored for message threads (as well as how it defaults to private for standalone threads).

src/http/client.rs Outdated Show resolved Hide resolved
@arqunis arqunis added enhancement An improvement to Serenity. discord feature Related to Discord's functionality. labels Jun 24, 2023
@arqunis arqunis merged commit 768b952 into serenity-rs:next Jul 6, 2023
arqunis pushed a commit to arqunis/serenity that referenced this pull request Jul 6, 2023
@fenhl fenhl deleted the standalone-public-thread branch July 6, 2023 22:09
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Jul 7, 2023
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Aug 28, 2023
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Sep 6, 2023
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Sep 21, 2023
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Sep 21, 2023
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Sep 21, 2023
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Sep 21, 2023
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Sep 21, 2023
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Oct 17, 2023
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Oct 23, 2023
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Oct 24, 2023
arqunis pushed a commit to arqunis/serenity that referenced this pull request Oct 24, 2023
arqunis pushed a commit to arqunis/serenity that referenced this pull request Oct 24, 2023
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Oct 24, 2023
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Nov 1, 2023
mkrasnitski added a commit to mkrasnitski/serenity that referenced this pull request Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builder Related to the `builder` module. discord feature Related to Discord's functionality. enhancement An improvement to Serenity. http Related to the `http` module. model Related to the `model` module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants