public class GuildController
extends java.lang.Object
Constructor and Description |
---|
GuildController(Guild guild)
Creates a new GuildController instance
for the specified Guild instance
|
Modifier and Type | Method and Description |
---|---|
RestAction<java.lang.Void> |
addRolesToMember(Member member,
java.util.Collection<Role> roles)
|
RestAction<java.lang.Void> |
addRolesToMember(Member member,
Role... roles)
|
RestAction<java.lang.Void> |
ban(Member member,
int delDays)
Bans a
Member and deletes messages sent by the user
based on the amount of delDays. |
RestAction<java.lang.Void> |
ban(java.lang.String userId,
int delDays)
Bans the a user specified by the userId and deletes messages sent by the user
based on the amount of delDays.
|
RestAction<java.lang.Void> |
ban(User user,
int delDays)
Bans a
User and deletes messages sent by the user
based on the amount of delDays. |
ChannelAction |
createCopyOfChannel(Channel channel)
|
RoleAction |
createCopyOfRole(Role role)
|
RestAction<Emote> |
createEmote(java.lang.String name,
Icon icon,
Role... roles)
Creates a new
Emote in this Guild. |
RoleAction |
createRole()
Creates a new
Role in this Guild. |
ChannelAction |
createTextChannel(java.lang.String name)
Creates a new
TextChannel in this Guild. |
ChannelAction |
createVoiceChannel(java.lang.String name)
Creates a new
VoiceChannel in this Guild. |
WebhookAction |
createWebhook(TextChannel channel,
java.lang.String name)
Creates a new
Webhook for the specified
TextChannel . |
RestAction<java.util.List<User>> |
getBans()
Gets an unmodifiable list of the currently banned
Users . |
Guild |
getGuild()
The underlying
Guild instance |
JDA |
getJDA()
The
JDA instance of this GuildController |
RestAction<java.lang.Integer> |
getPrunableMemberCount(int days)
The method calculates the amount of Members that would be pruned if
prune(int) was executed. |
RestAction<java.lang.Void> |
kick(Member member)
|
RestAction<java.lang.Void> |
kick(java.lang.String userId)
|
RestAction<java.lang.Void> |
modifyMemberRoles(Member member,
java.util.Collection<Role> roles)
|
RestAction<java.lang.Void> |
modifyMemberRoles(Member member,
java.util.Collection<Role> rolesToAdd,
java.util.Collection<Role> rolesToRemove)
|
RestAction<java.lang.Void> |
modifyMemberRoles(Member member,
Role... roles)
|
RoleOrderAction |
modifyRolePositions()
Modifies the positional order of
Guild.getRoles()
using a specific RestAction extension to allow moving Roles
up /down
or to a specific position. |
RoleOrderAction |
modifyRolePositions(boolean useDiscordOrder)
Modifies the positional order of
Guild.getRoles()
using a specific RestAction extension to allow moving Roles
up /down
or to a specific position. |
ChannelOrderAction<TextChannel> |
modifyTextChannelPositions()
Modifies the positional order of
Guild.getTextChannels()
using a specific RestAction extension to allow moving Channels
up /down
or to a specific position. |
ChannelOrderAction<VoiceChannel> |
modifyVoiceChannelPositions()
Modifies the positional order of
Guild.getVoiceChannels()
using a specific RestAction extension to allow moving Channels
up /down
or to a specific position. |
RestAction<java.lang.Void> |
moveVoiceMember(Member member,
VoiceChannel voiceChannel)
|
RestAction<java.lang.Integer> |
prune(int days)
This method will prune (kick) all members who were offline for at least days days.
|
RestAction<java.lang.Void> |
removeRolesFromMember(Member member,
java.util.Collection<Role> roles)
|
RestAction<java.lang.Void> |
removeRolesFromMember(Member member,
Role... roles)
|
RestAction<java.lang.Void> |
setDeafen(Member member,
boolean deafen)
Sets the Guild Deafened state state of the
Member based on the provided
boolean. |
RestAction<java.lang.Void> |
setMute(Member member,
boolean mute)
Sets the Guild Muted state state of the
Member based on the provided
boolean. |
RestAction<java.lang.Void> |
setNickname(Member member,
java.lang.String nickname)
Changes a Member's nickname in this guild.
|
RestAction<java.lang.Void> |
transferOwnership(Member newOwner)
Transfers the Guild ownership to the specified
Member
Only available if the currently logged in account is the owner of this Guild |
RestAction<java.lang.Void> |
unban(java.lang.String userId)
Unbans the a user specified by the userId from this Guild.
|
RestAction<java.lang.Void> |
unban(User user)
Unbans the specified
User from this Guild. |
public Guild getGuild()
Guild
instanceGuild
instancepublic JDA getJDA()
JDA
instance of this GuildControllerpublic RestAction<java.lang.Void> setNickname(Member member, java.lang.String nickname)
To change the nickname for the currently logged in account
only the Permission NICKNAME_CHANGE
is required.
To change the nickname of any Member
for this Guild
the Permission NICKNAME_MANAGE
is required.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
member
- The Member
for which the nickname should be changed.nickname
- The new nickname of the Member
, provide null
or an
empty String to reset the nicknameRestAction
java.lang.IllegalArgumentException
- If the specified Member
is not from the same Guild
.
Or if the provided member is null
PermissionException
- Permission.NICKNAME_CHANGE
nor Permission.NICKNAME_MANAGE
Permission.NICKNAME_MANAGE
PermissionUtil.canInteract(Member, Member)
GuildUnavailableException
- If the guild is temporarily not available
public RestAction<java.lang.Void> moveVoiceMember(Member member, VoiceChannel voiceChannel)
Member
from one VoiceChannel
to another VoiceChannel
.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
UNKNOWN_CHANNEL
member
- The Member
that you are moving.voiceChannel
- The destination VoiceChannel
to which the member is being
moved to.RestAction
java.lang.IllegalStateException
- If the Member isn't currently in a VoiceChannel in this Guild.java.lang.IllegalArgumentException
- PermissionException
- Permission.VOICE_MOVE_OTHERS
in the VoiceChannel that the Member is currently in.Permission.VOICE_CONNECT
for the destination VoiceChannel.GuildUnavailableException
- If the guild is temporarily not available
public RestAction<java.lang.Integer> prune(int days)
getPrunableMemberCount(int)
to determine how many Members would be pruned if you were to
call this method.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
days
- Minimum number of days since a member has been offline to get affected.RestAction
- Type: Integer
PermissionException
- If the account doesn't have KICK_MEMBER
Permission.GuildUnavailableException
- If the guild is temporarily not available
java.lang.IllegalArgumentException
- If the provided days are less than 1
public RestAction<java.lang.Integer> getPrunableMemberCount(int days)
prune(int)
was executed.
Prunability is determined by a Member being offline for at least days days.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
days
- Minimum number of days since a member has been offline to get affected.RestAction
- Type: Integer
PermissionException
- If the account doesn't have KICK_MEMBER
Permission.GuildUnavailableException
- If the guild is temporarily not available
java.lang.IllegalArgumentException
- If the provided days are less than 1
public RestAction<java.lang.Void> kick(Member member)
Member
from the Guild
.
Note: Guild.getMembers()
will still contain the User
until Discord sends the GuildMemberLeaveEvent
.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
member
- The Member
to kick from the from the Guild
.RestAction
Kicks the provided Member from the current Guildjava.lang.IllegalArgumentException
- If the provided member is not a Member of this Guild or is null
GuildUnavailableException
- If the guild is temporarily not available
PermissionException
- Permission.KICK_MEMBERS
permission.PermissionUtil.canInteract(Member, Member)
public RestAction<java.lang.Void> kick(java.lang.String userId)
Member
specified by the userId from the from the Guild
.
Note: Guild.getMembers()
will still contain the User
until Discord sends the GuildMemberLeaveEvent
.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
userId
- The id of the User
to kick from the from the Guild
.RestAction
PermissionException
- Permission.KICK_MEMBERS
permission.PermissionUtil.canInteract(Member, Member)
java.lang.IllegalArgumentException
- If the userId provided does not correspond to a Member in this Guild or the provided userId
is blank/null.GuildUnavailableException
- If the guild is temporarily not available
public RestAction<java.lang.Void> ban(Member member, int delDays)
Member
and deletes messages sent by the user
based on the amount of delDays.
Note: Guild.getMembers()
will still contain the
Member
until Discord sends the
GuildMemberLeaveEvent
.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
member
- The Member
to ban.delDays
- The history of messages, in days, that will be deleted.RestAction
PermissionException
- Permission.BAN_MEMBERS
permission.PermissionUtil.canInteract(Member, Member)
java.lang.IllegalArgumentException
- null
GuildUnavailableException
- If the guild is temporarily not available
public RestAction<java.lang.Void> ban(User user, int delDays)
User
and deletes messages sent by the user
based on the amount of delDays.
Note: Guild.getMembers()
will still contain the User's
Member
object (if the User was in the Guild)
until Discord sends the GuildMemberLeaveEvent
.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
user
- The User
to ban.delDays
- The history of messages, in days, that will be deleted.RestAction
PermissionException
- Permission.BAN_MEMBERS
permission.PermissionUtil.canInteract(Member, Member)
java.lang.IllegalArgumentException
- GuildUnavailableException
- If the guild is temporarily not available
public RestAction<java.lang.Void> ban(java.lang.String userId, int delDays)
Note: Guild.getMembers()
will still contain the User's
Member
object (if the User was in the Guild)
until Discord sends the GuildMemberLeaveEvent
.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
userId
- The id of the User
to ban.delDays
- The history of messages, in days, that will be deleted.RestAction
PermissionException
- Permission.BAN_MEMBERS
permission.PermissionUtil.canInteract(Member, Member)
java.lang.IllegalArgumentException
- If the provided amount of days (delDays) is less than 0.GuildUnavailableException
- If the guild is temporarily not available
public RestAction<java.lang.Void> unban(User user)
User
from this Guild.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_USER
user
- The id of the User
to unban.RestAction
PermissionException
- If the logged in account does not have the Permission.BAN_MEMBERS
permission.GuildUnavailableException
- If the guild is temporarily not available
java.lang.IllegalArgumentException
- If the provided user is nullpublic RestAction<java.lang.Void> unban(java.lang.String userId)
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_USER
userId
- The id of the User
to unban.RestAction
PermissionException
- If the logged in account does not have the Permission.BAN_MEMBERS
permission.GuildUnavailableException
- If the guild is temporarily not available
java.lang.IllegalArgumentException
- If the provided id is null or blankpublic RestAction<java.lang.Void> setDeafen(Member member, boolean deafen)
Member
based on the provided
boolean.
Note: The Member's GuildVoiceState.isGuildDeafened()
value won't change
until JDA receives the GuildVoiceGuildDeafenEvent
event related to this change.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
member
- The Member
who's VoiceState
is being changed.deafen
- Whether this Member
should be deafened or undeafened.RestAction
PermissionException
- Permission.VOICE_DEAF_OTHERS
permission.java.lang.IllegalArgumentException
- If the provided member is not from this Guild or null.GuildUnavailableException
- If the guild is temporarily not available
public RestAction<java.lang.Void> setMute(Member member, boolean mute)
Member
based on the provided
boolean.
Note: The Member's GuildVoiceState.isGuildMuted()
value won't change
until JDA receives the GuildVoiceGuildMuteEvent
event related to this change.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
member
- The Member
who's VoiceState
is being changed.mute
- Whether this Member
should be muted or unmuted.RestAction
PermissionException
- Permission.VOICE_MUTE_OTHERS
permission.java.lang.IllegalArgumentException
- If the provided member is not from this Guild or null.GuildUnavailableException
- If the guild is temporarily not available
public RestAction<java.util.List<User>> getBans()
Users
.
ban(net.dv8tion.jda.core.entities.User, int)
or
unban(net.dv8tion.jda.core.entities.User)
.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
RestAction
- Type: List<User
>
PermissionException
- If the logged in account does not have the Permission.BAN_MEMBERS
permission.GuildUnavailableException
- If the guild is temporarily not available
public RestAction<java.lang.Void> addRolesToMember(Member member, Role... roles)
Roles
to the specified Member
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
member
- Not-null Member
that will receive all provided rolesroles
- Not-null Roles that should be added to the specified MemberRestAction
GuildUnavailableException
- If the guild is temporarily not available
PermissionException
- If the provided roles are higher in the Guild's hierarchy
and thus cannot be modified by the currently logged in accountjava.lang.IllegalArgumentException
- addRolesToMember(Member, Collection)
,
modifyMemberRoles(Member, Role...)
public RestAction<java.lang.Void> addRolesToMember(Member member, java.util.Collection<Role> roles)
Roles
to the specified Member
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
member
- Not-null Member
that will receive all provided rolesroles
- Not-null Roles that should be added to the specified MemberRestAction
GuildUnavailableException
- If the guild is temporarily not available
PermissionException
- If the provided roles are higher in the Guild's hierarchy
and thus cannot be modified by the currently logged in accountjava.lang.IllegalArgumentException
- addRolesToMember(Member, Role...)
,
modifyMemberRoles(Member, Collection)
public RestAction<java.lang.Void> removeRolesFromMember(Member member, Role... roles)
Roles
from the specified Member
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
member
- Not-null Member
from which to remove the Roles
roles
- Not-null Roles that should be removed from the specified MemberRestAction
GuildUnavailableException
- If the guild is temporarily not available
PermissionException
- If the provided roles are higher in the Guild's hierarchy
and thus cannot be modified by the currently logged in accountjava.lang.IllegalArgumentException
- addRolesToMember(Member, Collection)
,
modifyMemberRoles(Member, Role...)
public RestAction<java.lang.Void> removeRolesFromMember(Member member, java.util.Collection<Role> roles)
Roles
from the specified Member
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
member
- Not-null Member
from which to remove the Roles
roles
- Not-null Roles that should be removed from the specified MemberRestAction
GuildUnavailableException
- If the guild is temporarily not available
PermissionException
- If the provided roles are higher in the Guild's hierarchy
and thus cannot be modified by the currently logged in accountjava.lang.IllegalArgumentException
- addRolesToMember(Member, Role...)
,
modifyMemberRoles(Member, Collection)
public RestAction<java.lang.Void> modifyMemberRoles(Member member, java.util.Collection<Role> rolesToAdd, java.util.Collection<Role> rolesToRemove)
Roles
of the specified Member
by adding and removing a collection of roles.
rolesToAdd
and rolesToRemove
it will be removed.
None of the provided collections may be null
To only add or remove roles use either removeRolesFromMember(Member, Collection)
or addRolesToMember(Member, Collection)
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
member
- The Member
that should be modifiedrolesToAdd
- A Collection
of Roles
to add to the current Roles the specified Member
already hasrolesToRemove
- A Collection
of Roles
to remove from the current Roles the specified Member
already hasRestAction
GuildUnavailableException
- If the guild is temporarily not available
PermissionException
- If the provided roles are higher in the Guild's hierarchy
and thus cannot be modified by the currently logged in accountjava.lang.IllegalArgumentException
- null
Public Role
of the Guildpublic RestAction<java.lang.Void> modifyMemberRoles(Member member, Role... roles)
Role
set of the specified Member
The new roles must not contain the Public Role of the Guild
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
member
- A Member
of which to override the Roles ofroles
- New collection of Roles
for the specified MemberRestAction
GuildUnavailableException
- If the guild is temporarily not available
PermissionException
- If the provided roles are higher in the Guild's hierarchy
and thus cannot be modified by the currently logged in accountjava.lang.IllegalArgumentException
- modifyMemberRoles(Member, Collection)
public RestAction<java.lang.Void> modifyMemberRoles(Member member, java.util.Collection<Role> roles)
Role
set of the specified Member
The new roles must not contain the Public Role of the Guild
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
member
- A Member
of which to override the Roles ofroles
- New collection of Roles
for the specified MemberRestAction
GuildUnavailableException
- If the guild is temporarily not available
PermissionException
- If the provided roles are higher in the Guild's hierarchy
and thus cannot be modified by the currently logged in accountjava.lang.IllegalArgumentException
- modifyMemberRoles(Member, Collection)
public RestAction<java.lang.Void> transferOwnership(Member newOwner)
Member
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
UNKNOWN_MEMBER
newOwner
- Not-null Member to transfer ownership toRestAction
GuildUnavailableException
- If the guild is temporarily not available
PermissionException
- If the currently logged in account is not the owner of this Guildjava.lang.IllegalArgumentException
- null
or not from the same GuildAccountType.BOT
)public ChannelAction createTextChannel(java.lang.String name)
TextChannel
in this Guild.
For this to be successful, the logged in account has to have the MANAGE_CHANNEL
Permission
The new roles must not contain the Public Role of the Guild
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
name
- The name of the TextChannel to createChannelAction
- Type: TextChannel
PermissionException
- If the logged in account does not have the Permission.MANAGE_CHANNEL
permissionGuildUnavailableException
- If the guild is temporarily not available
java.lang.IllegalArgumentException
- If the provided name is null
or less than 2 characters or greater than 100 characters in lengthpublic ChannelAction createVoiceChannel(java.lang.String name)
VoiceChannel
in this Guild.
For this to be successful, the logged in account has to have the MANAGE_CHANNEL
Permission.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
name
- The name of the VoiceChannel to createChannelAction
- Type: VoiceChannel
PermissionException
- If the logged in account does not have the Permission.MANAGE_CHANNEL
permissionGuildUnavailableException
- If the guild is temporarily not available
java.lang.IllegalArgumentException
- If the provided name is null
or less than 2 characters or greater than 100 characters in lengthpublic ChannelAction createCopyOfChannel(Channel channel)
Channel
in this Guild
.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
channel
- The Channel
to use for the copy templateChannelAction
java.lang.IllegalArgumentException
- If the provided channel is null
PermissionException
- If the currently logged in account does not have the MANAGE_CHANNEL
PermissioncreateTextChannel(String)
,
createVoiceChannel(String)
,
ChannelAction
public WebhookAction createWebhook(TextChannel channel, java.lang.String name)
Webhook
for the specified
TextChannel
.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
channel
- The target TextChannel to attach a new Webhook to.name
- The default name for the new Webhook.WebhookAction
PermissionException
- If you do not hold the permission Manage Webhooks
on the selected channeljava.lang.IllegalArgumentException
- null
TextChannel
is not from this Guildpublic RoleAction createRole()
Role
in this Guild.
MANAGE_ROLES
Permission
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
MAX_ROLES_PER_GUILD
RoleAction
PermissionException
- If the logged in account does not have the Permission.MANAGE_ROLES
PermissionGuildUnavailableException
- If the guild is temporarily not available
public RoleAction createCopyOfRole(Role role)
Role
in this Guild
with the same settings as the given Role
.
It will be placed at the bottom (just over the Public Role) to avoid permission hierarchy conflicts.
For this to be successful, the logged in account has to have the MANAGE_ROLES
Permission
and all Permissions
the given Role
has.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
MAX_ROLES_PER_GUILD
role
- The Role
that should be copiedRoleAction
Role
PermissionException
- If the logged in account does not have the Permission.MANAGE_ROLES
Permission and every Permission the provided Role hasGuildUnavailableException
- If the guild is temporarily not available
java.lang.IllegalArgumentException
- If the specified role is null
or not from this Guildpublic RestAction<Emote> createEmote(java.lang.String name, Icon icon, Role... roles)
Emote
in this Guild.
Member.canInteract(Emote)
)
MANAGE_EMOTES
Permission.
Possible ErrorResponses
caused by
the returned RestAction
include the following:
MISSING_PERMISSIONS
MISSING_ACCESS
name
- The name for the new Emoteicon
- The Icon
for the new Emoteroles
- The Roles
the new Emote should be restricted to
RestAction
- Type: Emote
PermissionException
- If the logged in account does not have the MANAGE_EMOTES
PermissionGuildUnavailableException
- If the guild is temporarily not available
AccountTypeException
- If the logged in account is not from AccountType.CLIENT
public ChannelOrderAction<TextChannel> modifyTextChannelPositions()
Guild.getTextChannels()
using a specific RestAction
extension to allow moving Channels
up
/down
or to
a specific position.
Possible ErrorResponses
include:
UNNKOWN_CHANNEL
MISSING_ACCESS
ChannelOrderAction
- Type: TextChannel
public ChannelOrderAction<VoiceChannel> modifyVoiceChannelPositions()
Guild.getVoiceChannels()
using a specific RestAction
extension to allow moving Channels
up
/down
or to
a specific position.
Possible ErrorResponses
include:
UNNKOWN_CHANNEL
MISSING_ACCESS
ChannelOrderAction
- Type: VoiceChannel
public RoleOrderAction modifyRolePositions()
Guild.getRoles()
using a specific RestAction
extension to allow moving Roles
up
/down
or to
a specific position.
This uses the ordering defined by Discord, which is descending!
This means the highest role appears at index 0
and the lower role at index n - 1
.
Providing false
to modifyRolePositions(boolean)
will result in the ordering being
in ascending order, with the lower role at index 0
and the highest at index n - 1
.
As a note: Member.getRoles()
and Guild.getRoles()
are both in descending order.
Possible ErrorResponses
include:
UNKNOWN_ROLE
MISSING_ACCESS
RoleOrderAction
public RoleOrderAction modifyRolePositions(boolean useDiscordOrder)
Guild.getRoles()
using a specific RestAction
extension to allow moving Roles
up
/down
or to
a specific position.
Possible ErrorResponses
include:
UNKNOWN_ROLE
MISSING_ACCESS
useDiscordOrder
- Defines the ordering of the OrderAction. If true
, the OrderAction will be in the ordering
defined by Discord for roles, which is Descending. This means that the highest role appears at index 0
and the lowest role at index n - 1
. Providing false
will result in the ordering being
in ascending order, with the lower role at index 0
and the highest at index n - 1
.
Member.getRoles()
and Guild.getRoles()
are both in descending order.RoleOrderAction