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

Document Membership Screening #2396

Merged
merged 15 commits into from
Jan 13, 2021
Merged

Document Membership Screening #2396

merged 15 commits into from
Jan 13, 2021

Conversation

advaith1
Copy link
Contributor

@advaith1 advaith1 commented Dec 22, 2020

👋

  • MEMBER_VERIFICATION_GATE_ENABLED and PREVIEW_ENABLED guild features
  • Membership Screening object
  • GET and PATCH routes

@SinisterRectus
Copy link
Contributor

Some sort of narrative documentation about screening should be added. Something that explains how it works in the context of the API. How GUILD_MEMBER_ADD is emitted on the initial join and GUILD_MEMBER_UPDATE is emitted for the screening completion (if I have that right).

@advaith1
Copy link
Contributor Author

advaith1 commented Dec 22, 2020

added an explanation of screening


in 2fe4e62's desc I saw

true -> member is pending
false -> member becomes no longer pending (i.e., becomes a regular member)
not serialized -> member is not pending

which seems to indicate that pending should only be false in guild member update at the time the user accepts the rules, and it shouldn't be present anytime after; however, I see pending: false on a normal nickname change? can we have some clarification on this or is it a bug? it would be useful to many bots to know if this is the event caused by the user accepting the rules (so if there is some behavior with it not included, it should be documented)

Copy link
Contributor

@ckohen ckohen left a comment

Choose a reason for hiding this comment

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

Couple of typos here.

@advaith1
Copy link
Contributor Author

pending was previously added to the Guild Member object but looks like Guild Member Update Fields is a different object (might just be due to the legacy of presence data there?) so I added it to that too

advaith1 and others added 2 commits December 22, 2020 17:17
@HuyaneMatsu
Copy link
Contributor

When editing form_fields I always get 500 Internal server error, so I asume Discord wont merge it for a while (if they even will).

@advaith1
Copy link
Contributor Author

advaith1 commented Dec 24, 2020

@HuyaneMatsu you're probably sending an array instead of a string (#2394), you need to serialize the array to a string as this PR documents

@HuyaneMatsu
Copy link
Contributor

@advaith1 Didn't see that issue :KoishiDerp:. The issue tracker is spammed with slash commands.

@tipakA tipakA mentioned this pull request Dec 26, 2020
5 tasks
vladfrangu added a commit to discordjs/discord-api-types that referenced this pull request Dec 28, 2020
@msciotti
Copy link
Contributor

msciotti commented Jan 7, 2021

Looks good to us once the merge conflict is fixed. Thanks @Kamilla-K for the review!

@advaith1
Copy link
Contributor Author

advaith1 commented Jan 7, 2021

could someone from Discord answer #2396 (comment)? i could mention it in the docs if its clarified

@Kamilla-K
Copy link
Contributor

added an explanation of screening

in 2fe4e62's desc I saw

true -> member is pending
false -> member becomes no longer pending (i.e., becomes a regular member)
not serialized -> member is not pending

which seems to indicate that pending should only be false in guild member update at the time the user accepts the rules, and it shouldn't be present anytime after; however, I see pending: false on a normal nickname change? can we have some clarification on this or is it a bug? it would be useful to many bots to know if this is the event caused by the user accepting the rules (so if there is some behavior with it not included, it should be documented)
@advaith1

sorry for the confusion- did some digging and found out what's happening:

for our GUILD_ events that contain member (like GUILD_CREATE, GUILD_MEMBER_UPDATE, etc), we will always serialize pending and it will either be true or false.

the only times pending is not serialized, is for non GUILD_ events that contain member (for example, VOICE_STATE_UPDATE). for these events, pending members can't trigger them anyway, so the member returned with that event will never be serialized.

hope that makes sense!

@advaith1
Copy link
Contributor Author

advaith1 commented Jan 7, 2021

ah, I see; that makes sense although it's unfortunate that bots can't tell if the member update event is being triggered by the member passing screening.

I've added a bit about when pending is included to the pr, I think it's done now.

@ckohen
Copy link
Contributor

ckohen commented Jan 7, 2021

Maybe also add to the member structure (after the similar note about user):

The field pending won't be included in the member object attached to events that do not begin with GUILD_

@advaith1
Copy link
Contributor Author

advaith1 commented Jan 7, 2021

hm, maybe just completely move it there?

@ckohen
Copy link
Contributor

ckohen commented Jan 7, 2021

yeah, that could work too

Copy link
Contributor

@Kamilla-K Kamilla-K left a comment

Choose a reason for hiding this comment

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

thanks for documenting this!

@rickling
Copy link
Contributor

thx @advaith1

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.

8 participants