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

Remove setting/getting of main character in guild #36

Open
danbopes opened this issue Feb 27, 2018 · 1 comment
Open

Remove setting/getting of main character in guild #36

danbopes opened this issue Feb 27, 2018 · 1 comment

Comments

@danbopes
Copy link
Contributor

Currently the main character is set from !setmainchar and fetched from this function:

public String getMainCharacterForUserInGuild(User user, Guild guild) {
    MongoCollection<Document> collection = getBot().getMongoDatabase().getCollection(MONGO_WOW_CHARACTERS_COLLECTION);
    //We first search for an existing main character and unset it.
    Document document = collection.find(and(eq("owner", user.getId()), eq("guild_id", guild.getId()))).first();

    return document != null ? document.getString("name") : null;
}

This seems like an added step. Why not sort the guild by rank, and fetch the highest ranking character in the guild for this user?

@greatman
Copy link
Owner

greatman commented Mar 1, 2018

I like the idea a lot, but I would still like the user-set main character to still be available in case you want a specific character and not just your highest.

Keep in mind ranks are from 0 to 9, 0 being GM.

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

No branches or pull requests

2 participants