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

Disable owner caching when guild subs are off #1156

Merged
merged 4 commits into from
Dec 14, 2019

Conversation

MinnDevelopment
Copy link
Member

Pull Request Etiquette

Changes

  • Internal code
  • Library interface (affecting end-user code)
  • Documentation
  • Other: _____

Closes Issue: NaN

Description

The owner cache will be outdated when guild subscriptions are disabled thus we need to disable it as well.

@DV8FromTheWorld
Copy link
Member

Is there a way to explicitly fetch the current owner?

@MinnDevelopment
Copy link
Member Author

@DV8FromTheWorld yes there is:

long ownerId = guild.getOwnerIdLong();
guild.retrieveMemberById(ownerId).queue(...);

@MinnDevelopment
Copy link
Member Author

I added a convenience method and linked to it from getOwner():

guild.retrieveOwner().queue(
    (member) -> System.out.printf("The owner is %#s\n", member.getUser())
);

@DV8FromTheWorld
Copy link
Member

Good job Github.. Double commits.

@MinnDevelopment MinnDevelopment merged commit 77b787b into development Dec 14, 2019
@MinnDevelopment MinnDevelopment deleted the patch-guild-owner branch December 14, 2019 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants