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

Additional invite info #678

Merged
merged 3 commits into from
Jun 8, 2018
Merged

Additional invite info #678

merged 3 commits into from
Jun 8, 2018

Conversation

jagrosh
Copy link
Collaborator

@jagrosh jagrosh commented Apr 29, 2018

Pull Request Etiquette

There are several guidelines you should follow in order for your
Pull Request to be merged.

It is sometimes better to include more changes in a single commit.
If you find yourself having an overwhelming amount of commits, you
can rebase your branch.

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.

@MinnDevelopment MinnDevelopment added status: documentation needed lacks documentation, either partially or completely type: feature status: in progress already in the process of being implemented labels Apr 29, 2018
@MinnDevelopment MinnDevelopment added this to the Release 3.6.1 milestone Apr 30, 2018
@@ -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);
Copy link
Member

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?

Copy link
Collaborator Author

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.

Copy link
Member

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;
Copy link
Member

Choose a reason for hiding this comment

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

import order

@MinnDevelopment MinnDevelopment added status: completed has been completed but is not yet released and removed status: in progress already in the process of being implemented status: documentation needed lacks documentation, either partially or completely labels Jun 7, 2018
Copy link
Member

@MinnDevelopment MinnDevelopment left a comment

Choose a reason for hiding this comment

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

lgtm

@jagrosh jagrosh merged commit b3b03b1 into development Jun 8, 2018
@MinnDevelopment MinnDevelopment deleted the feature/more-invite-info branch June 8, 2018 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: completed has been completed but is not yet released type: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants