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.GuildMemberModifyRequestasRequest()StringgetReason()Returns the current audit log reason set on the spec.LegacyGuildMemberEditSpecsetDeafen(boolean deaf)Sets whether the targetedMemberis deafened in voice channels, if they are connected to voice.LegacyGuildMemberEditSpecsetMute(boolean mute)Sets whether the targetedMemberis muted in voice channels, if they are connected to voice.LegacyGuildMemberEditSpecsetNewVoiceChannel(Snowflake channel)Sets the new voice channel to move the targetedMember, if they are connected to voice.LegacyGuildMemberEditSpecsetNickname(String nickname)Sets a new nickname to the targetedMember.LegacyGuildMemberEditSpecsetReason(String reason)Sets the reason to show in the audit logs when the spec is built.LegacyGuildMemberEditSpecsetRoles(Set<Snowflake> roles)Sets the new role identifiers the targetedMemberis 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_MEMBERSpermission.- Parameters:
channel- The voice channel identifier ornullto disconnect from voice channel.- Returns:
- This spec.
-
setMute
public LegacyGuildMemberEditSpec setMute(boolean mute)
Sets whether the targetedMemberis muted in voice channels, if they are connected to voice. Requires thePermission.MUTE_MEMBERSpermission.- Parameters:
mute-trueif theMembershould be muted,falseotherwise.- Returns:
- This spec.
-
setDeafen
public LegacyGuildMemberEditSpec setDeafen(boolean deaf)
Sets whether the targetedMemberis deafened in voice channels, if they are connected to voice. Requires thePermission.DEAFEN_MEMBERSpermission.- Parameters:
deaf-trueif theMembershould be deafened,falseotherwise.- Returns:
- This spec.
-
setNickname
public LegacyGuildMemberEditSpec setNickname(@Nullable String nickname)
Sets a new nickname to the targetedMember. Requires thePermission.MANAGE_NICKNAMESpermission.- Parameters:
nickname- The new nickname, can benullor an empty string to reset.- Returns:
- This spec.
-
setRoles
public LegacyGuildMemberEditSpec setRoles(Set<Snowflake> roles)
Sets the new role identifiers the targetedMemberis assigned. Requires thePermission.MANAGE_ROLESpermission.- Parameters:
roles- The set of role identifiers.- Returns:
- This spec.
-
setReason
public LegacyGuildMemberEditSpec setReason(@Nullable String reason)
Description copied from interface:LegacyAuditSpecSets the reason to show in the audit logs when the spec is built.- Specified by:
setReasonin interfaceLegacyAuditSpec<discord4j.discordjson.json.GuildMemberModifyRequest>- Parameters:
reason- The audit log reason.- Returns:
- This spec.
-
getReason
@Nullable public String getReason()
Description copied from interface:LegacyAuditSpecReturns the current audit log reason set on the spec.- Specified by:
getReasonin interfaceLegacyAuditSpec<discord4j.discordjson.json.GuildMemberModifyRequest>- Returns:
- The current audit log reason.
-
asRequest
public discord4j.discordjson.json.GuildMemberModifyRequest asRequest()
- Specified by:
asRequestin interfaceLegacySpec<discord4j.discordjson.json.GuildMemberModifyRequest>
-
-