// Path: src/main/java/stream/flarebot/flarebot/Getters.java
// public class Getters {
// 
//     private static FlareBot flareBot() {
//         return FlareBot.instance();
//     }
// 
//     // getXCache
//     public static SnowflakeCacheView<Guild> getGuildCache() {
//         return getShardManager().getGuildCache();
//     }
// 
//     public static SnowflakeCacheView<TextChannel> getTextChannelCache() {
//         return getShardManager().getTextChannelCache();
//     }
// 
//     public static SnowflakeCacheView<VoiceChannel> getVoiceChannelCache() {
//         return getShardManager().getVoiceChannelCache();
//     }
// 
//     public static SnowflakeCacheView<User> getUserCache() {
//         return getShardManager().getUserCache();
//     }
// 
//     // getXById
//     @Nullable
//     public static TextChannel getChannelById(String id) {
//         return getShardManager().getTextChannelById(id);
//     }
// 
//     @Nullable
//     public static TextChannel getChannelById(long id) {
//         return getShardManager().getTextChannelById(id);
//     }
// 
//     @Nullable
//     public static Guild getGuildById(String id) {
//         return getShardManager().getGuildById(id);
//     }
// 
//     @Nullable
//     public static Guild getGuildById(long id) {
//         return getShardManager().getGuildById(id);
//     }
// 
//     @Nullable
//     public static Emote getEmoteById(long emoteId) {
//         return getShardManager().getEmoteById(emoteId);
//     }
// 
//     @Nullable
//     public static User getUserById(String id) {
//         return getShardManager().getUserById(id);
//     }
// 
//     @Nullable
//     public static User getUserById(long id) {
//         return getShardManager().getUserById(id);
//     }
// 
//     @Nullable
//     public static Role getRoleById(String id) {
//         return getShardManager().getRoleById(id);
//     }
// 
//     @Nullable
//     public static Role getRoleById(long id) {
//         return getShardManager().getRoleById(id);
//     }
// 
// 
//     @Nullable
//     public static User retrieveUserById(long id) {
//         try {
//             return flareBot().getClient().retrieveUserById(id).complete();
//         } catch (ErrorResponseException e) {
//             return null;
//         }
//     }
// 
//     // Audio
//     public static long getConnectedVoiceChannels() {
//         return getShardManager().getGuildCache().stream()
//                 .filter(c -> c.getAudioManager().getConnectedChannel() != null).count();
//     }
// 
//     public static Set<VoiceChannel> getConnectedVoiceChannel() {
//         return getShardManager().getGuildCache().stream().filter(c -> c.getAudioManager().getConnectedChannel() != null)
//                 .map(g -> g.getAudioManager().getConnectedChannel())
//                 .collect(Collectors.toSet());
//     }
// 
//     public static long getActiveVoiceChannels() {
//         return getShardManager().getGuildCache().stream()
//                 .filter(c -> c.getAudioManager().getConnectedChannel() != null)
//                 .map(g -> flareBot().getMusicManager().getPlayer(g.getId()))
//                 .filter(p -> p != null && p.getPlayingTrack() != null && !p.getPaused())
//                 .count();
//     }
// 
//     public static int getSongsQueued() {
//         return flareBot().getMusicManager().getPlayers().stream()
//                 .mapToInt(p -> p.getPlaylist().size())
//                 .sum();
//     }
// 
//     // Other
//     public static List<JDA> getShards() {
//         return flareBot().getShardManager().getShards();
//     }
// 
//     @Nonnull
//     public static SelfUser getSelfUser() {
//         return flareBot().getClient().getSelfUser();
//     }
// 
//     @Nonnull
//     public static ShardManager getShardManager() {
//         return flareBot().getShardManager();
//     }
// 
//     public static Guild getOfficialGuild() {
//         return getGuildById(Constants.OFFICIAL_GUILD);
//     }
// }


import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.User;
import stream.flarebot.flarebot.Getters;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
package stream.flarebot.flarebot.util.votes;



public class VoteGroup {

    private int yesVotes = 0;
    private int noVotes = 0;

    private final Set<Long> users = new HashSet<>();
    private Set<Long> allowedUsers = new HashSet<>();

    private final String messageDesc;

    private Message voteMessage;
    private long messageId;
    private EmbedBuilder votesEmbed;

    private UUID id;

    public VoteGroup(String messageDesc, UUID id) {
        this.messageDesc = messageDesc;
        this.id = id;
    }

    public boolean addVote(Vote vote, User user) {
        if (allowedUsers != null && voteMessage != null && !allowedUsers.contains(user.getIdLong()))
            return false;
        if (!users.contains(user.getIdLong())) {
            if (vote == Vote.NO)
                noVotes++;
            else
                yesVotes++;

            if (allowedUsers.size() == totalVotes()) {
// Path: src/main/java/stream/flarebot/flarebot/Getters.java
// public class Getters {
// 
//     private static FlareBot flareBot() {
//         return FlareBot.instance();
//     }
// 
//     // getXCache
//     public static SnowflakeCacheView<Guild> getGuildCache() {
//         return getShardManager().getGuildCache();
//     }
// 
//     public static SnowflakeCacheView<TextChannel> getTextChannelCache() {
//         return getShardManager().getTextChannelCache();
//     }
// 
//     public static SnowflakeCacheView<VoiceChannel> getVoiceChannelCache() {
//         return getShardManager().getVoiceChannelCache();
//     }
// 
//     public static SnowflakeCacheView<User> getUserCache() {
//         return getShardManager().getUserCache();
//     }
// 
//     // getXById
//     @Nullable
//     public static TextChannel getChannelById(String id) {
//         return getShardManager().getTextChannelById(id);
//     }
// 
//     @Nullable
//     public static TextChannel getChannelById(long id) {
//         return getShardManager().getTextChannelById(id);
//     }
// 
//     @Nullable
//     public static Guild getGuildById(String id) {
//         return getShardManager().getGuildById(id);
//     }
// 
//     @Nullable
//     public static Guild getGuildById(long id) {
//         return getShardManager().getGuildById(id);
//     }
// 
//     @Nullable
//     public static Emote getEmoteById(long emoteId) {
//         return getShardManager().getEmoteById(emoteId);
//     }
// 
//     @Nullable
//     public static User getUserById(String id) {
//         return getShardManager().getUserById(id);
//     }
// 
//     @Nullable
//     public static User getUserById(long id) {
//         return getShardManager().getUserById(id);
//     }
// 
//     @Nullable
//     public static Role getRoleById(String id) {
//         return getShardManager().getRoleById(id);
//     }
// 
//     @Nullable
//     public static Role getRoleById(long id) {
//         return getShardManager().getRoleById(id);
//     }
// 
// 
//     @Nullable
//     public static User retrieveUserById(long id) {
//         try {
//             return flareBot().getClient().retrieveUserById(id).complete();
//         } catch (ErrorResponseException e) {
//             return null;
//         }
//     }
// 
//     // Audio
//     public static long getConnectedVoiceChannels() {
//         return getShardManager().getGuildCache().stream()
//                 .filter(c -> c.getAudioManager().getConnectedChannel() != null).count();
//     }
// 
//     public static Set<VoiceChannel> getConnectedVoiceChannel() {
//         return getShardManager().getGuildCache().stream().filter(c -> c.getAudioManager().getConnectedChannel() != null)
//                 .map(g -> g.getAudioManager().getConnectedChannel())
//                 .collect(Collectors.toSet());
//     }
// 
//     public static long getActiveVoiceChannels() {
//         return getShardManager().getGuildCache().stream()
//                 .filter(c -> c.getAudioManager().getConnectedChannel() != null)
//                 .map(g -> flareBot().getMusicManager().getPlayer(g.getId()))
//                 .filter(p -> p != null && p.getPlayingTrack() != null && !p.getPaused())
//                 .count();
//     }
// 
//     public static int getSongsQueued() {
//         return flareBot().getMusicManager().getPlayers().stream()
//                 .mapToInt(p -> p.getPlaylist().size())
//                 .sum();
//     }
// 
//     // Other
//     public static List<JDA> getShards() {
//         return flareBot().getShardManager().getShards();
//     }
// 
//     @Nonnull
//     public static SelfUser getSelfUser() {
//         return flareBot().getClient().getSelfUser();
//     }
// 
//     @Nonnull
//     public static ShardManager getShardManager() {
//         return flareBot().getShardManager();
//     }
// 
//     public static Guild getOfficialGuild() {
//         return getGuildById(Constants.OFFICIAL_GUILD);
//     }
// }


// Path: src/main/java/stream/flarebot/flarebot/util/votes/VoteGroup.java
import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.User;
import stream.flarebot.flarebot.Getters;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;

package stream.flarebot.flarebot.util.votes;



public class VoteGroup {

    private int yesVotes = 0;
    private int noVotes = 0;

    private final Set<Long> users = new HashSet<>();
    private Set<Long> allowedUsers = new HashSet<>();

    private final String messageDesc;

    private Message voteMessage;
    private long messageId;
    private EmbedBuilder votesEmbed;

    private UUID id;

    public VoteGroup(String messageDesc, UUID id) {
        this.messageDesc = messageDesc;
        this.id = id;
    }

    public boolean addVote(Vote vote, User user) {
        if (allowedUsers != null && voteMessage != null && !allowedUsers.contains(user.getIdLong()))
            return false;
        if (!users.contains(user.getIdLong())) {
            if (vote == Vote.NO)
                noVotes++;
            else
                yesVotes++;

            if (allowedUsers.size() == totalVotes()) {
                VoteUtil.finishNow(id, Getters.getGuildById(voteMessage.getId()));