Class AutoModActionExecutedEvent
- java.lang.Object
-
- discord4j.core.event.domain.Event
-
- discord4j.core.event.domain.automod.AutoModActionExecutedEvent
-
public class AutoModActionExecutedEvent extends Event
Dispatched when an automod action is executed. This event is dispatched by Discord.- See Also:
- Auto Moderation Action Execution
-
-
Constructor Summary
Constructors Constructor Description AutoModActionExecutedEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, discord4j.discordjson.json.gateway.AutoModActionExecution autoModActionExecution)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AutoModRuleAction
getAction()
Gets the automod rule action involved in the event.Mono<AutoModRule>
getAutoModRule()
Requests to retrieve theAutoModRule
related to this event.Snowflake
getAutoModRuleId()
Gets theSnowflake
ID of theAutoModRule
related to this event.Mono<MessageChannel>
getChannel()
Requests to retrieve theMessageChannel
involved in this event, if present.Optional<Snowflake>
getChannelId()
Gets theSnowflake
ID of theMessageChannel
involved in this event, if present.String
getContent()
Gets the User-generated text content.discord4j.discordjson.json.gateway.AutoModActionExecution
getData()
Gets the data of the AutoMod action involved in the event.Mono<Guild>
getGuild()
Requests to retrieve theGuild
involved in the event.Snowflake
getGuildId()
Optional<String>
getMatchedContent()
Gets the Substring in content that triggered the rule, if present.Optional<String>
getMatchedKeyword()
Gets the Word or phrase configured in the rule that triggered the rule, if present.Mono<Member>
getMember()
Mono<Message>
getMessage()
Requests to retrieve theMessage
involved in this event, if present.Optional<Snowflake>
getMessageId()
Gets theSnowflake
ID of theMessageChannel
involved in this event, if present.Optional<Snowflake>
getSystemMessageId()
AutoModRule.TriggerType
getTriggerType()
Gets the trigger type of rule which was triggeredMono<User>
getUser()
Requests to retrieve theUser
who's generated the content which triggered the rule.Snowflake
getUserId()
-
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
-
-
-
Constructor Detail
-
AutoModActionExecutedEvent
public AutoModActionExecutedEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, discord4j.discordjson.json.gateway.AutoModActionExecution autoModActionExecution)
-
-
Method Detail
-
getData
public discord4j.discordjson.json.gateway.AutoModActionExecution getData()
Gets the data of the AutoMod action involved in the event.- Returns:
- The data of the AutoMod action.
-
getAction
public AutoModRuleAction getAction()
Gets the automod rule action involved in the event.- Returns:
- The action of the automod rule.
-
getAutoModRuleId
public Snowflake getAutoModRuleId()
Gets theSnowflake
ID of theAutoModRule
related to this event.- Returns:
- The ID of the
AutoModRule
related to this event.
-
getAutoModRule
public Mono<AutoModRule> getAutoModRule()
Requests to retrieve theAutoModRule
related to this event.- Returns:
- A
Mono
where, upon successful completion, emits theAutoModRule
involved in this event. If an error is received, it is emitted through theMono
.
-
getTriggerType
public AutoModRule.TriggerType getTriggerType()
Gets the trigger type of rule which was triggered- Returns:
- The trigger type of the automod rule.
-
getUser
public Mono<User> getUser()
Requests to retrieve theUser
who's generated the content which triggered the rule.
-
getChannelId
public Optional<Snowflake> getChannelId()
- Returns:
- The ID of the
MessageChannel
involved, if present.
-
getChannel
public Mono<MessageChannel> getChannel()
Requests to retrieve theMessageChannel
involved in this event, if present.Message
is in.- Returns:
- A
Mono
where, upon successful completion, emits theMessageChannel
involved. If an error is received, it is emitted through theMono
.
-
getMessageId
public Optional<Snowflake> getMessageId()
- Returns:
- the ID of the
MessageChannel
involved, if present.
-
getMessage
public Mono<Message> getMessage()
Requests to retrieve theMessage
involved in this event, if present.
-
getSystemMessageId
public Optional<Snowflake> getSystemMessageId()
- Returns:
- the ID of the system
Message
involved, if present.
-
getContent
public String getContent()
Gets the User-generated text content.- Returns:
- The contents.
-
getMatchedKeyword
public Optional<String> getMatchedKeyword()
Gets the Word or phrase configured in the rule that triggered the rule, if present.- Returns:
- The matched keyword, if present.
-
-