-
-
Notifications
You must be signed in to change notification settings - Fork 734
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
Additional invite info #678
Conversation
@@ -1260,8 +1261,11 @@ public Invite createInvite(JSONObject object) | |||
final long guildId = guildObject.getLong("id"); | |||
final String guildName = guildObject.getString("name"); | |||
final String guildSplashId = guildObject.optString("splash", null); | |||
final VerificationLevel guildVerificationLevel = VerificationLevel.fromKey(guildObject.optInt("verification_level", -1)); | |||
final int presenceCount = object.optInt("approximate_presence_count", -1); | |||
final int memberCount = object.optInt("approximate_member_count", -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be in the guild object if discord doesn't provide them in the guild object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not provided in the guild object, but from a library user's standpoint I think it might make more sense. Either way would be fine from an implementation standpoint though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with either, too
@@ -23,6 +23,7 @@ | |||
|
|||
import javax.annotation.CheckReturnValue; | |||
import java.time.OffsetDateTime; | |||
import net.dv8tion.jda.core.entities.Guild.VerificationLevel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Pull Request Etiquette
There are several guidelines you should follow in order for your
Pull Request to be merged.
Description
This PR fulfills #666 by adding an additional Invite.resolve method to allow getting counts and verification level from invites.
Still needed at this time: docs, possibly exceptions if the resolved invite is not one that contains counts.