Package discord4j.core.spec.legacy
Class LegacyGuildMemberEditSpec
- java.lang.Object
-
- discord4j.core.spec.legacy.LegacyGuildMemberEditSpec
-
- All Implemented Interfaces:
LegacyAuditSpec<discord4j.discordjson.json.GuildMemberModifyRequest>
,LegacySpec<discord4j.discordjson.json.GuildMemberModifyRequest>
public class LegacyGuildMemberEditSpec extends Object implements LegacyAuditSpec<discord4j.discordjson.json.GuildMemberModifyRequest>
LegacySpec used to modify guild members.- See Also:
- Modify Guild Member
-
-
Constructor Summary
Constructors Constructor Description LegacyGuildMemberEditSpec()
-
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.LegacyGuildMemberEditSpec
setDeafen(boolean deaf)
Sets whether the targetedMember
is deafened in voice channels, if they are connected to voice.LegacyGuildMemberEditSpec
setMute(boolean mute)
Sets whether the targetedMember
is muted in voice channels, if they are connected to voice.LegacyGuildMemberEditSpec
setNewVoiceChannel(Snowflake channel)
Sets the new voice channel to move the targetedMember
, if they are connected to voice.LegacyGuildMemberEditSpec
setNickname(String nickname)
Sets a new nickname to the targetedMember
.LegacyGuildMemberEditSpec
setReason(String reason)
Sets the reason to show in the audit logs when the spec is built.LegacyGuildMemberEditSpec
setRoles(Set<Snowflake> roles)
Sets the new role identifiers the targetedMember
is assigned.
-
-
-
Method Detail
-
setNewVoiceChannel
public LegacyGuildMemberEditSpec 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 LegacyGuildMemberEditSpec 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 LegacyGuildMemberEditSpec 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 LegacyGuildMemberEditSpec 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 LegacyGuildMemberEditSpec 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 LegacyGuildMemberEditSpec setReason(@Nullable String reason)
Description copied from interface:LegacyAuditSpec
Sets the reason to show in the audit logs when the spec is built.- Specified by:
setReason
in interfaceLegacyAuditSpec<discord4j.discordjson.json.GuildMemberModifyRequest>
- Parameters:
reason
- The audit log reason.- Returns:
- This spec.
-
getReason
@Nullable public String getReason()
Description copied from interface:LegacyAuditSpec
Returns the current audit log reason set on the spec.- Specified by:
getReason
in interfaceLegacyAuditSpec<discord4j.discordjson.json.GuildMemberModifyRequest>
- Returns:
- The current audit log reason.
-
asRequest
public discord4j.discordjson.json.GuildMemberModifyRequest asRequest()
- Specified by:
asRequest
in interfaceLegacySpec<discord4j.discordjson.json.GuildMemberModifyRequest>
-
-