Remove setting/getting of main character in guild
Opened this issue · 1 comments
danbopes commented
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 commented
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.