Class AutoModRule

    • Constructor Detail

      • AutoModRule

        public AutoModRule​(GatewayDiscordClient gateway,
                           discord4j.discordjson.json.AutoModRuleData data)
    • Method Detail

      • getData

        public discord4j.discordjson.json.AutoModRuleData getData()
      • getId

        public Snowflake getId()
        Description copied from interface: Entity
        Gets the Snowflake that uniquely identifies this entity.
        Specified by:
        getId in interface Entity
        Returns:
        The Snowflake that uniquely identifies this entity.
      • getCreatorUser

        public Mono<User> getCreatorUser()
        Requests to retrieve the User who has created this rule.
        Returns:
        A Mono where, upon successful completion, emits the User that has started typing. If an error is received, it is emitted through the Mono.
      • isEnabled

        public boolean isEnabled()
        Gets if the rule is enabled.
        Returns:
        true if this rule is enabled, false otherwise.
      • getName

        public String getName()
        Gets the name of the rule
        Returns:
        the name of the rule
      • getTriggerType

        public AutoModRule.TriggerType getTriggerType()
        Gets the type of trigger used in the rule.
        Returns:
        The type of trigger used in the rule.
      • getExemptChannelsIds

        public List<Snowflake> getExemptChannelsIds()
      • edit

        public discord4j.core.spec.AutoModRuleEditMono edit​(String name,
                                                            AutoModRule.EventType eventType,
                                                            boolean enabled)
        Requests to edit this AutoMod rule. Properties specifying how to edit this rule can be set via the withXxx methods of the returned AutoModRuleEditMono.
        Parameters:
        name - new name to set
        eventType - type of event to set
        enabled - status of the rule
        Returns:
        A AutoModRuleEditMono where, upon successful completion, emits the edited AutoModRule. If an error is received, it is emitted through the AutoModRuleEditMono.
      • edit

        public Mono<AutoModRule> edit​(discord4j.core.spec.AutoModRuleEditSpec spec)
        Requests to edit this AutoMod rule.
        Parameters:
        spec - an immutable object that specifies how to edit this AutoMod Rule
        Returns:
        A Mono where, upon successful completion, emits the edited AutoModRule. If an error is received, it is emitted through the Mono.
      • delete

        public Mono<Void> delete()
        Requests to delete this rule.
        Returns:
        A Mono where, upon successful completion, emits nothing; indicating the rule has been deleted. If an error is received, it is emitted through the Mono.
      • delete

        public Mono<Void> delete​(@Nullable
                                 String reason)
        Requests to delete this rule while optionally specifying a reason.
        Parameters:
        reason - The reason, if present.
        Returns:
        A Mono where, upon successful completion, emits nothing; indicating the rule has been deleted. If an error is received, it is emitted through the Mono.