public interface Channel extends ISnowflake
Guild channel.| Modifier and Type | Method and Description |
|---|---|
InviteAction |
createInvite()
Creates a new
InviteAction which can be used to create a
new Invite. |
PermissionOverrideAction |
createPermissionOverride(Member member)
Creates a
PermissionOverride
for the specified Member in this Channel. |
PermissionOverrideAction |
createPermissionOverride(Role role)
Creates a
PermissionOverride
for the specified Role in this Channel. |
AuditableRestAction<java.lang.Void> |
delete()
Deletes this Channel.
|
Guild |
getGuild()
Returns the
Guild that this Channel is part of. |
RestAction<java.util.List<Invite>> |
getInvites()
Returns all invites for this channel.
|
JDA |
getJDA()
Returns the
JDA instance of this Channel |
ChannelManager |
getManager()
Returns the
ChannelManager for this Channel. |
ChannelManagerUpdatable |
getManagerUpdatable()
Returns the
ChannelManagerUpdatable for this Channel. |
java.util.List<PermissionOverride> |
getMemberPermissionOverrides()
|
java.util.List<Member> |
getMembers()
A List of all
Members that are in this Channel
For TextChannels,
this returns all Members with the Permission.MESSAGE_READ Permission. |
java.lang.String |
getName()
The human readable name of the Channel.
|
PermissionOverride |
getPermissionOverride(Member member)
The
PermissionOverride relating to the specified Member. |
PermissionOverride |
getPermissionOverride(Role role)
The
PermissionOverride relating to the specified Role. |
java.util.List<PermissionOverride> |
getPermissionOverrides()
Gets all of the
PermissionOverrides that are part
of this Channel. |
int |
getPosition()
The position this Channel is displayed at.
|
int |
getPositionRaw()
The actual position of the
Channel as stored and given by Discord. |
java.util.List<PermissionOverride> |
getRolePermissionOverrides()
|
ChannelType |
getType()
The
ChannelType for this Channel |
getCreationTime, getId, getIdLongChannelType getType()
ChannelType for this Channeljava.lang.String getName()
Guild getGuild()
Guild that this Channel is part of.Guild that this Channel is part of.java.util.List<Member> getMembers()
Members that are in this Channel
For TextChannels,
this returns all Members with the Permission.MESSAGE_READ Permission.
In VoiceChannels,
this returns all Members that joined that VoiceChannel.Members that are in this Channel.int getPosition()
Guild do not have to have continuous positionsint getPositionRaw()
Channel as stored and given by Discord.
Role positions are actually based on a pairing of the creation time (as stored in the snowflake id)
and the position. If 2 or more roles share the same position then they are sorted based on their creation date.
The more recent a role was created, the lower it is in the hierarchy. This is handled by getPosition()
and it is most likely the method you want. If, for some reason, you want the actual position of the
Role then this method will give you that value.Channel.JDA getJDA()
JDA instance of this ChannelPermissionOverride getPermissionOverride(Member member)
PermissionOverride relating to the specified Member.
If there is no PermissionOverride for this Channel
relating to the provided Member, then this returns null.member - The Member whose
PermissionOverride is requested.PermissionOverride
relating to the provided Member.PermissionOverride getPermissionOverride(Role role)
PermissionOverride relating to the specified Role.
If there is no PermissionOverride for this Channel
relating to the provided Role, then this returns null.role - The Role whose PermissionOverride is requested.PermissionOverride
relating to the provided Role.java.util.List<PermissionOverride> getPermissionOverrides()
PermissionOverrides that are part
of this Channel.
Member and Role overrides.
If you would like only Member overrides or only Role
overrides, use getMemberPermissionOverrides() or getRolePermissionOverrides() respectively.PermissionOverrides
for this Channel.java.util.List<PermissionOverride> getMemberPermissionOverrides()
PermissionOverrides
for Member
for this Channel.java.util.List<PermissionOverride> getRolePermissionOverrides()
PermissionOverrides
for Roles
for this Channel.ChannelManager getManager()
ChannelManager for this Channel.
In the ChannelManager, you can modify the name, topic and position of this Channel.getManagerUpdatable()ChannelManagerUpdatable getManagerUpdatable()
ChannelManagerUpdatable for this Channel.
In the ChannelManager, you can modify the name, topic and position of this Channel.
getManager()@CheckReturnValue AuditableRestAction<java.lang.Void> delete()
Possible ErrorResponses include:
UNKNOWN_CHANNEL
MISSING_PERMISSIONS
Permission.MANAGE_CHANNEL in the channel.MISSING_ACCESS
AuditableRestActionInsufficientPermissionException - if the currently logged in account doesn't have MANAGE_CHANNEL
for the channel.@CheckReturnValue PermissionOverrideAction createPermissionOverride(Member member)
PermissionOverride
for the specified Member in this Channel.
Possible ErrorResponses include:
UNKNOWN_CHANNEL
MISSING_ACCESS
member - The Member to create an override forPermissionOverrideAction
The newly created PermissionOverride for the specified RoleInsufficientPermissionException - if we don't have the permission to MANAGE_PERMISSIONSjava.lang.IllegalArgumentException - if the specified Member is null or the Member is not from getGuild()java.lang.IllegalStateException - If the specified Member already has a PermissionOverride. Use getPermissionOverride(Member) to retrieve it.createPermissionOverride(Role)@CheckReturnValue PermissionOverrideAction createPermissionOverride(Role role)
PermissionOverride
for the specified Role in this Channel.
Possible ErrorResponses include:
UNKNOWN_CHANNEL
MISSING_ACCESS
role - The Role to create an override forPermissionOverrideAction
The newly created PermissionOverride for the specified RoleInsufficientPermissionException - if we don't have the permission to MANAGE_PERMISSIONSjava.lang.IllegalArgumentException - if the specified Role is null or the Role is not from getGuild()java.lang.IllegalStateException - If the specified Role already has a PermissionOverride. Use getPermissionOverride(Role) to retrieve it.createPermissionOverride(Member)@CheckReturnValue InviteAction createInvite()
InviteAction which can be used to create a
new Invite.
CREATE_INSTANT_INVITE in this channel.InviteActionInsufficientPermissionException - if the account does not have CREATE_INSTANT_INVITE in this channelInviteAction@CheckReturnValue RestAction<java.util.List<Invite>> getInvites()
MANAGE_CHANNEL in this channel.
Will throw a InsufficientPermissionException otherwise.RestAction - Type: List<Invite>
InsufficientPermissionException - if the account does not have MANAGE_CHANNEL in this channelGuild.getInvites()