@Override public IVoiceChannel getVoiceChannelByID(long id) { return guildCache.findResult((guildID, guild) -> guild.getVoiceChannelByID(id)); }
@Override public boolean isDeleted() { return getGuild().getVoiceChannelByID(getLongID()) != this; } }
/** * Converts a json {@link VoiceStateObject} to a {@link IVoiceState}. * * @param guild The guild the voice state is in. * @param json The json object representing the voice state. * @return The converted voice state object. */ public static IVoiceState getVoiceStateFromJson(IGuild guild, VoiceStateObject json) { IVoiceChannel channel = json.channel_id != null ? guild.getVoiceChannelByID(Long.parseUnsignedLong(json.channel_id)) : null; return new VoiceState(guild, channel, guild.getUserByID(Long.parseUnsignedLong(json.user_id)), json.session_id, json.deaf, json.mute, json.self_deaf, json.self_mute, json.suppress); }
case CHANNEL_OVERWRITE_DELETE: IChannel channel = guild.getChannelByID(targetID); if (channel == null) channel = guild.getVoiceChannelByID(targetID);