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()
ChannelJDA instance of this Channelpublic PermissionOverride getOverrideForUser(User user)
ChannelPermissionOverride 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 Channeluser - The User whose PermissionOverride is requested.PermissionOverride relating to the provided User.public PermissionOverride getOverrideForRole(Role role)
ChannelPermissionOverride 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 Channelrole - The Role whose PermissionOverride is requested.PermissionOverride relating to the provided Role.public java.util.List<PermissionOverride> getPermissionOverrides()
ChannelPermissionOverrides 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 ChannelPermissionOverrides for this Channel.public java.util.List<PermissionOverride> getUserPermissionOverrides()
ChannelgetUserPermissionOverrides in interface ChannelPermissionOverrides for Users
for this Channel.public java.util.List<PermissionOverride> getRolePermissionOverrides()
ChannelgetRolePermissionOverrides in interface ChannelPermissionOverrides for Roles
for this Channel.public java.lang.String getId()
Channelpublic java.lang.String getName()
Channelpublic Guild getGuild()
ChannelGuild that this Channel is part of.public int getPosition()
ChannelGuild do not have to have continuous positionsgetPosition in interface Channelpublic java.util.List<User> getUsers()
ChannelUsers 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)
ChannelUser has the given Permission
in this ChannelcheckPermission in interface Channeluser - the User to check the Permission againstperm - the Permission to check forpublic ChannelManager getManager()
ChannelChannelManager for this Channel.
In the ChannelManager, you can modify the name, topic and position of this Channel.getManager in interface Channelpublic PermissionOverrideManager createPermissionOverride(User user)
ChannelPermissionOverride for a given User.
For this to be successful, the logged in account has to have the MANAGE_PERMISSIONS PermissioncreatePermissionOverride in interface Channeluser - the User to create an Override forpublic PermissionOverrideManager createPermissionOverride(Role role)
ChannelPermissionOverride for a given Role.
For this to be successful, the logged in account has to have the MANAGE_PERMISSIONS PermissioncreatePermissionOverride in interface Channelrole - 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()
Channelpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object