public class VoiceChannelImpl extends java.lang.Object implements VoiceChannel
Constructor and Description |
---|
VoiceChannelImpl(java.lang.String id,
Guild guild) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkPermission(User user,
Permission perm)
Checks if the given
User has the given Permission
in this Channel |
PermissionOverrideManager |
createPermissionOverride(Role role)
Creates a new
PermissionOverride for a given Role . |
PermissionOverrideManager |
createPermissionOverride(User user)
Creates a new
PermissionOverride for a given User . |
boolean |
equals(java.lang.Object o) |
Guild |
getGuild()
Returns the
Guild that this Channel is part of. |
java.lang.String |
getId()
The Id of the Channel.
|
JDA |
getJDA()
Returns the
JDA instance of this Channel |
ChannelManager |
getManager()
Returns the
ChannelManager for this Channel. |
java.lang.String |
getName()
The human readable name of the Channel.
If no name has been set, this returns null. |
PermissionOverride |
getOverrideForRole(Role role)
The
PermissionOverride relating to the specified Role . |
PermissionOverride |
getOverrideForUser(User user)
The
PermissionOverride relating to the specified User . |
java.util.List<PermissionOverride> |
getPermissionOverrides()
Gets all of the
PermissionOverrides that are part
of this Channel .This combines User and Role overrides. |
int |
getPosition()
The position this Channel is displayed at.
Higher values mean they are displayed lower in the Client. |
java.util.List<PermissionOverride> |
getRolePermissionOverrides()
|
java.util.Map<Role,PermissionOverride> |
getRolePermissionOverridesMap() |
java.lang.String |
getTopic()
The topic set for this Channel.
|
java.util.List<PermissionOverride> |
getUserPermissionOverrides()
|
java.util.Map<User,PermissionOverride> |
getUserPermissionOverridesMap() |
java.util.List<User> |
getUsers()
A List of all
Users that are in this Channel
For TextChannels , this returns all Users with the Permission.MESSAGE_READ Permission. |
java.util.List<User> |
getUsersModifiable() |
int |
hashCode() |
VoiceChannelImpl |
setName(java.lang.String name) |
VoiceChannelImpl |
setPosition(int position) |
VoiceChannelImpl |
setUsers(java.util.List<User> connectedUsers) |
java.lang.String |
toString() |
public VoiceChannelImpl(java.lang.String id, Guild guild)
public JDA getJDA()
Channel
JDA
instance of this Channelpublic PermissionOverride getOverrideForUser(User user)
Channel
PermissionOverride
relating to the specified User
.
If there is no PermissionOverride
for this Channel
relating to the provided User
, then this returns null
.getOverrideForUser
in interface Channel
user
- The User
whose PermissionOverride
is requested.PermissionOverride
relating to the provided User
.public PermissionOverride getOverrideForRole(Role role)
Channel
PermissionOverride
relating to the specified Role
.
If there is no PermissionOverride
for this Channel
relating to the provided Role
, then this returns null
.getOverrideForRole
in interface Channel
role
- The Role
whose PermissionOverride
is requested.PermissionOverride
relating to the provided Role
.public java.util.List<PermissionOverride> getPermissionOverrides()
Channel
PermissionOverrides
that are part
of this Channel
.User
and Role
overrides.
If you would like only User
overrides or only Role
overrides, use Channel.getUserPermissionOverrides()
or Channel.getRolePermissionOverrides()
respectively.getPermissionOverrides
in interface Channel
PermissionOverrides
for this Channel
.public java.util.List<PermissionOverride> getUserPermissionOverrides()
Channel
getUserPermissionOverrides
in interface Channel
PermissionOverrides
for Users
for this Channel
.public java.util.List<PermissionOverride> getRolePermissionOverrides()
Channel
getRolePermissionOverrides
in interface Channel
PermissionOverrides
for Roles
for this Channel
.public java.lang.String getId()
Channel
public java.lang.String getName()
Channel
public Guild getGuild()
Channel
Guild
that this Channel is part of.public int getPosition()
Channel
Guild
do not have to have continuous positionsgetPosition
in interface Channel
public java.util.List<User> getUsers()
Channel
Users
that are in this Channel
For TextChannels
, this returns all Users with the Permission.MESSAGE_READ
Permission.
In VoiceChannels
, this returns all Users that joined that VoiceChannel.public boolean checkPermission(User user, Permission perm)
Channel
User
has the given Permission
in this ChannelcheckPermission
in interface Channel
user
- the User to check the Permission againstperm
- the Permission to check forpublic ChannelManager getManager()
Channel
ChannelManager
for this Channel.
In the ChannelManager, you can modify the name, topic and position of this Channel.getManager
in interface Channel
public PermissionOverrideManager createPermissionOverride(User user)
Channel
PermissionOverride
for a given User
.
For this to be successful, the logged in account has to have the MANAGE_PERMISSIONS Permission
createPermissionOverride
in interface Channel
user
- the User to create an Override forpublic PermissionOverrideManager createPermissionOverride(Role role)
Channel
PermissionOverride
for a given Role
.
For this to be successful, the logged in account has to have the MANAGE_PERMISSIONS Permission
createPermissionOverride
in interface Channel
role
- the Role to create an Override forpublic VoiceChannelImpl setName(java.lang.String name)
public VoiceChannelImpl setPosition(int position)
public VoiceChannelImpl setUsers(java.util.List<User> connectedUsers)
public java.util.List<User> getUsersModifiable()
public java.util.Map<User,PermissionOverride> getUserPermissionOverridesMap()
public java.util.Map<Role,PermissionOverride> getRolePermissionOverridesMap()
public java.lang.String getTopic()
Channel
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object