/** * The {@link net.dv8tion.jda.core.entities.GuildVoiceState GuildVoiceState} of the member * <br>Shortcut for {@code getMember().getVoiceState()} * * @return The {@link net.dv8tion.jda.core.entities.GuildVoiceState GuildVoiceState} of the member */ public GuildVoiceState getVoiceState() { return member.getVoiceState(); } }
public GuildVoiceDeafenEvent(JDA api, long responseNumber, Member member) { super(api, responseNumber, member); this.deafened = member.getVoiceState().isDeafened(); }
public GuildVoiceSuppressEvent(JDA api, long responseNumber, Member member) { super(api, responseNumber, member); this.suppressed = member.getVoiceState().isSuppressed(); }
public GuildVoiceSelfDeafenEvent(JDA api, long responseNumber, Member member) { super(api, responseNumber, member); this.selfDeafened = member.getVoiceState().isSelfDeafened(); }
public GuildVoiceJoinEvent(JDA api, long responseNumber, Member member) { super(api, responseNumber, member); this.channelJoined = member.getVoiceState().getChannel(); }
public GuildVoiceSelfMuteEvent(JDA api, long responseNumber, Member member) { super(api, responseNumber, member); this.selfMuted = member.getVoiceState().isSelfMuted(); }
public GuildVoiceMoveEvent(JDA api, long responseNumber, Member member, VoiceChannel channelLeft) { super(api, responseNumber, member, channelLeft); this.channelJoined = member.getVoiceState().getChannel(); }
public GuildVoiceGuildDeafenEvent(JDA api, long responseNumber, Member member) { super(api, responseNumber, member); this.guildDeafened = member.getVoiceState().isGuildDeafened(); }
public GuildVoiceMuteEvent(JDA api, long responseNumber, Member member) { super(api, responseNumber, member); this.muted = member.getVoiceState().isMuted(); }
public GuildVoiceGuildMuteEvent(JDA api, long responseNumber, Member member) { super(api, responseNumber, member); this.guildMuted = member.getVoiceState().isGuildMuted(); }
GuildVoiceStateImpl voiceState = (GuildVoiceStateImpl) member.getVoiceState(); if (voiceState == null) continue;
throw new IllegalArgumentException("Attempted to start audio connection with Guild that doesn't exist!"); getJDA().getClient().updateAudioConnection(guildId, guild.getSelfMember().getVoiceState().getChannel()); String sessionId = guild.getSelfMember().getVoiceState().getSessionId(); if (sessionId == null) throw new IllegalArgumentException("Attempted to create audio connection without having a session ID. Did VOICE_STATE_UPDATED fail?");
final GuildVoiceState voiceState = guild.getSelfMember().getVoiceState(); client.updateAudioConnection0(guild.getIdLong(), voiceState.getChannel());
throw new HierarchyException("Cannot modify Guild Mute status the Owner of the Guild"); GuildVoiceState voiceState = member.getVoiceState(); if (voiceState != null && voiceState.isGuildMuted() == mute) return new AuditableRestAction.EmptyRestAction<>(getJDA(), null);
throw new HierarchyException("Cannot modify Guild Deafen status the Owner of the Guild"); GuildVoiceState voiceState = member.getVoiceState(); if (voiceState != null && voiceState.isGuildDeafened() == deafen) return new AuditableRestAction.EmptyRestAction<>(getJDA(), null);
checkGuild(voiceChannel.getGuild(), "VoiceChannel"); GuildVoiceState vState = member.getVoiceState(); if (vState == null) throw new IllegalStateException("Cannot move a Member with disabled CacheFlag.VOICE_STATE");
/** * Gets the connected voice channel for the given guild. * * @param guild The guild that the connected voice channel should be fetched for. * @return Possibly-null, The VoiceChannel that the bot is connected to. */ @Nullable public VoiceChannel getConnectedChannel(@Nonnull Guild guild) { return guild.getSelfMember().getVoiceState().getChannel(); }
private boolean canVoteSkip(CommandMessage message) { GuildVoiceState voiceState = message.getMember().getVoiceState(); GuildVoiceState selfVoteState = message.getGuild().getSelfMember().getVoiceState(); return voiceState.getChannel() != null && selfVoteState.getChannel() != null && voiceState.getChannel().getId().equals(selfVoteState.getChannel().getId()); } }
public boolean isMusicPlaying(JDA jda) { return guild(jda).getSelfMember().getVoiceState().inVoiceChannel() && audioPlayer.getPlayingTrack()!=null; }
public void onTrackUpdate(long guildId, AudioTrack track, AudioHandler handler) { // update bot status if applicable if(bot.getConfig().getSongInStatus()) { if(track!=null && bot.getJDA().getGuilds().stream().filter(g -> g.getSelfMember().getVoiceState().inVoiceChannel()).count()<=1) bot.getJDA().getPresence().setGame(Game.listening(track.getInfo().title)); else bot.resetGame(); } // update channel topic if applicable updateTopic(guildId, handler, false); }