Skip to content

feat(http, model): Implement screening API - #2572

Draft
Powerbyte7 wants to merge 1 commit into
twilight-rs:mainfrom
Powerbyte7:feat/screening
Draft

feat(http, model): Implement screening API#2572
Powerbyte7 wants to merge 1 commit into
twilight-rs:mainfrom
Powerbyte7:feat/screening

Conversation

@Powerbyte7

Copy link
Copy Markdown

Discord has recently exposed endpoints for bots to fetch, approve, and deny member join requests using the screening feature. This functionality hasn't been officially announced yet, but it's already part of the OpenAPI spec and shouldn't take much longer to release. In the meantime, I've decided to fork Twilight to adopt it early. I'm in a large server which could make good use of the automations it enables.

Here are some things I noticed whilst using the API:

  • Approving/denying a join request can be done with either a user ID or an application ID /requests/(user_id | application_id).
  • Denying, and then approving a join request can yield a successful HTTP response despite no change being applied. This also happens the other way around. I've added a must_use hint to prevent errors.
  • Fetching join requests without a status query parameter doesn't seem to work. This used to cause a 500 error, now it yields an empty list.
  • Fetching join requests requires the permission MANAGE_GUILD, approving and denying them requires KICK_MEMBERS.

And here are some notes about the implementation in this PR:

  • I've ran checked the code style guidelines and ran clippy.
  • I've added a new Id marker for join requests.
  • I've reused TextFieldResponse for Paragraph and TextInput. I think this can't hurt but let me know if separate structs are preferred instead.

Once the API is officially announced, I'll try to get this PR finalized. I've tried my best at following the code style, let me know if I've missed anything.

Post-announcement checklist:

  • Link to relevant Discord documentation.
  • Force inclusion of a status parameter for GetGuildJoinRequests, if it continues to yield empty lists.

@github-actions github-actions Bot added c-http Affects the http crate c-model Affects the model crate t-feature Addition of a new feature labels Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c-http Affects the http crate c-model Affects the model crate t-feature Addition of a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant