Package discord4j.core.spec
Class GuildMemberEditSpec
- java.lang.Object
-
- discord4j.core.spec.GuildMemberEditSpec
-
- All Implemented Interfaces:
AuditSpec<discord4j.discordjson.json.GuildMemberModifyRequest>
,Spec<discord4j.discordjson.json.GuildMemberModifyRequest>
public class GuildMemberEditSpec extends Object implements AuditSpec<discord4j.discordjson.json.GuildMemberModifyRequest>
Spec used to modify guild members.- See Also:
- Modify Guild Member
-
-
Constructor Summary
Constructors Constructor Description GuildMemberEditSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description discord4j.discordjson.json.GuildMemberModifyRequest
asRequest()
String
getReason()
Returns the current audit log reason set on the spec.GuildMemberEditSpec
setDeafen(boolean deaf)
Sets whether the targetedMember
is deafened in voice channels, if they are connected to voice.GuildMemberEditSpec
setMute(boolean mute)
Sets whether the targetedMember
is muted in voice channels, if they are connected to voice.GuildMemberEditSpec
setNewVoiceChannel(Snowflake channel)
Sets the new voice channel to move the targetedMember
, if they are connected to voice.GuildMemberEditSpec
setNickname(String nickname)
Sets a new nickname to the targetedMember
.GuildMemberEditSpec
setReason(String reason)
Sets the reason to show in the audit logs when the spec is built.GuildMemberEditSpec
setRoles(Set<Snowflake> roles)
Sets the new role identifiers the targetedMember
is assigned.
-
-
-
Method Detail
-
setNewVoiceChannel
public GuildMemberEditSpec setNewVoiceChannel(@Nullable Snowflake channel)
Sets the new voice channel to move the targetedMember
, if they are connected to voice. Requires thePermission.MOVE_MEMBERS
permission.- Parameters:
channel
- The voice channel identifier ornull
to disconnect from voice channel.- Returns:
- This spec.
-
setMute
public GuildMemberEditSpec setMute(boolean mute)
Sets whether the targetedMember
is muted in voice channels, if they are connected to voice. Requires thePermission.MUTE_MEMBERS
permission.- Parameters:
mute
-true
if theMember
should be muted,false
otherwise.- Returns:
- This spec.
-
setDeafen
public GuildMemberEditSpec setDeafen(boolean deaf)
Sets whether the targetedMember
is deafened in voice channels, if they are connected to voice. Requires thePermission.DEAFEN_MEMBERS
permission.- Parameters:
deaf
-true
if theMember
should be deafened,false
otherwise.- Returns:
- This spec.
-
setNickname
public GuildMemberEditSpec setNickname(@Nullable String nickname)
Sets a new nickname to the targetedMember
. Requires thePermission.MANAGE_NICKNAMES
permission.- Parameters:
nickname
- The new nickname, can benull
or an empty string to reset.- Returns:
- This spec.
-
setRoles
public GuildMemberEditSpec setRoles(Set<Snowflake> roles)
Sets the new role identifiers the targetedMember
is assigned. Requires thePermission.MANAGE_ROLES
permission.- Parameters:
roles
- The set of role identifiers.- Returns:
- This spec.
-
setReason
public GuildMemberEditSpec setReason(@Nullable String reason)
Description copied from interface:AuditSpec
Sets the reason to show in the audit logs when the spec is built.
-
getReason
@Nullable public String getReason()
Description copied from interface:AuditSpec
Returns the current audit log reason set on the spec.
-
-