/
GuildVoiceState.java
148 lines (131 loc) · 5.21 KB
/
GuildVoiceState.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*
* Copyright 2015 Austin Keener, Michael Ritter, Florian Spieß, and the JDA contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.dv8tion.jda.api.entities;
import net.dv8tion.jda.api.JDA;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* Represents the voice state of a {@link net.dv8tion.jda.api.entities.Member Member} in a
* {@link net.dv8tion.jda.api.entities.Guild Guild}.
*
* @see Member#getVoiceState()
*/
public interface GuildVoiceState
{
/**
* Returns the {@link net.dv8tion.jda.api.JDA JDA} instance of this VoiceState
*
* @return The corresponding JDA instance
*/
@Nonnull
JDA getJDA();
/**
* Returns whether the {@link net.dv8tion.jda.api.entities.Member Member} muted themselves.
*
* @return The User's self-mute status
*/
boolean isSelfMuted();
/**
* Returns whether the {@link net.dv8tion.jda.api.entities.Member Member} deafened themselves.
*
* @return The User's self-deaf status
*/
boolean isSelfDeafened();
/**
* Returns whether the {@link net.dv8tion.jda.api.entities.Member Member} is muted, either
* by choice {@link #isSelfMuted()} or muted by an admin {@link #isGuildMuted()}
*
* @return the Member's mute status
*/
boolean isMuted();
/**
* Returns whether the {@link net.dv8tion.jda.api.entities.Member Member} is deafened, either
* by choice {@link #isSelfDeafened()} or deafened by an admin {@link #isGuildDeafened()}
*
* @return the Member's deaf status
*/
boolean isDeafened();
/**
* Returns whether the {@link net.dv8tion.jda.api.entities.Member Member} got muted by an Admin
*
* @return the Member's guild-mute status
*/
boolean isGuildMuted();
/**
* Returns whether the {@link net.dv8tion.jda.api.entities.Member Member} got deafened by an Admin
*
* @return the Member's guild-deaf status
*/
boolean isGuildDeafened();
/**
* Returns true if this {@link net.dv8tion.jda.api.entities.Member Member} is unable to speak because the
* channel is actively suppressing audio communication. This occurs only in
* {@link net.dv8tion.jda.api.entities.VoiceChannel VoiceChannels} where the Member either doesn't have
* {@link net.dv8tion.jda.api.Permission#VOICE_SPEAK Permission#VOICE_SPEAK} or if the channel is the
* designated AFK channel.
*
* @return True, if this {@link net.dv8tion.jda.api.entities.Member Member's} audio is being suppressed.
*/
boolean isSuppressed();
/**
* Returns true if this {@link net.dv8tion.jda.api.entities.Member Member} is currently streaming with Go Live.
*
* @return True, if this member is streaming
*/
boolean isStream();
/**
* Returns the current {@link net.dv8tion.jda.api.entities.VoiceChannel VoiceChannel} that the {@link net.dv8tion.jda.api.entities.Member Member}
* is in. If the {@link net.dv8tion.jda.api.entities.Member Member} is currently not in a
* {@link net.dv8tion.jda.api.entities.VoiceChannel VoiceChannel}, this returns null.
*
* @return The VoiceChannel that the Member is in, or null.
*/
@Nullable
VoiceChannel getChannel();
/**
* Returns the current {@link net.dv8tion.jda.api.entities.Guild Guild} of the {@link net.dv8tion.jda.api.entities.Member Member's}
* {@link net.dv8tion.jda.api.entities.VoiceChannel VoiceChannel}. If the {@link net.dv8tion.jda.api.entities.Member Member} is currently
* not in a {@link net.dv8tion.jda.api.entities.VoiceChannel VoiceChannel}, this returns null
*
* @return the Member's Guild
*/
@Nonnull
Guild getGuild();
/**
* Returns the {@link net.dv8tion.jda.api.entities.Member Member} corresponding to this GuildVoiceState instance
* (Backreference)
*
* @return the Member that holds this GuildVoiceState
*/
@Nonnull
Member getMember();
/**
* Used to determine if the {@link net.dv8tion.jda.api.entities.Member Member} is currently in a {@link net.dv8tion.jda.api.entities.VoiceChannel VoiceChannel}
* in the {@link net.dv8tion.jda.api.entities.Guild Guild} returned from {@link #getGuild() getGuild()}.<br>
* If this is {@code false}, {@link #getChannel() getChannel()} will return {@code null}.
*
* @return True, if the {@link net.dv8tion.jda.api.entities.Member Member} is currently in a {@link net.dv8tion.jda.api.entities.VoiceChannel VoiceChannel}
* in this {@link net.dv8tion.jda.api.entities.Guild Guild}.
*/
boolean inVoiceChannel();
/**
* The Session-Id for this VoiceState
*
* @return The Session-Id
*/
@Nullable
String getSessionId();
}