Class 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 Detail

      • GuildMemberEditSpec

        public GuildMemberEditSpec()
    • Method Detail

      • setNewVoiceChannel

        public GuildMemberEditSpec setNewVoiceChannel​(@Nullable
                                                      Snowflake channel)
        Sets the new voice channel to move the targeted Member, if they are connected to voice. Requires the Permission.MOVE_MEMBERS permission.
        Parameters:
        channel - The voice channel identifier or null to disconnect from voice channel.
        Returns:
        This spec.
      • setMute

        public GuildMemberEditSpec setMute​(boolean mute)
        Sets whether the targeted Member is muted in voice channels, if they are connected to voice. Requires the Permission.MUTE_MEMBERS permission.
        Parameters:
        mute - true if the Member should be muted, false otherwise.
        Returns:
        This spec.
      • setDeafen

        public GuildMemberEditSpec setDeafen​(boolean deaf)
        Sets whether the targeted Member is deafened in voice channels, if they are connected to voice. Requires the Permission.DEAFEN_MEMBERS permission.
        Parameters:
        deaf - true if the Member should be deafened, false otherwise.
        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.
        Specified by:
        setReason in interface AuditSpec<discord4j.discordjson.json.GuildMemberModifyRequest>
        Parameters:
        reason - The audit log reason.
        Returns:
        This spec.
      • getReason

        @Nullable
        public String getReason()
        Description copied from interface: AuditSpec
        Returns the current audit log reason set on the spec.
        Specified by:
        getReason in interface AuditSpec<discord4j.discordjson.json.GuildMemberModifyRequest>
        Returns:
        The current audit log reason.
      • asRequest

        public discord4j.discordjson.json.GuildMemberModifyRequest asRequest()
        Specified by:
        asRequest in interface Spec<discord4j.discordjson.json.GuildMemberModifyRequest>