Class AutoModExecutionEvent
java.lang.Object
net.dv8tion.jda.api.events.Event
net.dv8tion.jda.api.events.automod.AutoModExecutionEvent
- All Implemented Interfaces:
AutoModExecution
,GenericEvent
Indicates that an automated
AutoModResponse
has been triggered through an AutoModRule
.
Requirements
This event requires the AUTO_MODERATION_EXECUTION
intent to be enabled.
This event will only fire for guilds where the bot has the MANAGE_SERVER
permission.
Additionally, access to getContent()
and getMatchedContent()
requires the MESSAGE_CONTENT
intent to be enabled.
-
Constructor Summary
ConstructorDescriptionAutoModExecutionEvent
(JDA api, long responseNumber, AutoModExecution execution) -
Method Summary
Modifier and TypeMethodDescriptionlong
The id of the alertMessage
sent to the alert channel.TheGuildMessageChannelUnion
that this execution occurred in.The user content that triggered this rule.getGuild()
TheGuild
that this execution occurred in.The substring match of the user content that triggered this rule.The keyword that was found in theAutoModExecution.getContent()
.long
The id of theMessage
which triggered the rule.TheAutoModResponse
that has been triggered by this execution.long
The id of theAutoModRule
which has been triggered.TheAutoModTriggerType
for the execution.long
The id of the user that triggered this execution.Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getRawData, getResponseNumber, toString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.dv8tion.jda.api.entities.automod.AutoModExecution
getAlertMessageId, getMessageId, getRuleId, getUserId
-
Constructor Details
-
AutoModExecutionEvent
public AutoModExecutionEvent(@Nonnull JDA api, long responseNumber, @Nonnull AutoModExecution execution)
-
-
Method Details
-
getGuild
Description copied from interface:AutoModExecution
TheGuild
that this execution occurred in.- Specified by:
getGuild
in interfaceAutoModExecution
- Returns:
- The
Guild
-
getChannel
Description copied from interface:AutoModExecution
TheGuildMessageChannelUnion
that this execution occurred in.This might be
null
if the execution occurred by future event types.- Specified by:
getChannel
in interfaceAutoModExecution
- Returns:
- The
GuildMessageChannelUnion
-
getResponse
Description copied from interface:AutoModExecution
TheAutoModResponse
that has been triggered by this execution.- Specified by:
getResponse
in interfaceAutoModExecution
- Returns:
- The
AutoModResponse
-
getTriggerType
Description copied from interface:AutoModExecution
TheAutoModTriggerType
for the execution.- Specified by:
getTriggerType
in interfaceAutoModExecution
- Returns:
- The
AutoModTriggerType
-
getUserIdLong
public long getUserIdLong()Description copied from interface:AutoModExecution
The id of the user that triggered this execution.- Specified by:
getUserIdLong
in interfaceAutoModExecution
- Returns:
- The id of the user
-
getRuleIdLong
public long getRuleIdLong()Description copied from interface:AutoModExecution
The id of theAutoModRule
which has been triggered.- Specified by:
getRuleIdLong
in interfaceAutoModExecution
- Returns:
- The id of the rule
-
getMessageIdLong
public long getMessageIdLong()Description copied from interface:AutoModExecution
The id of theMessage
which triggered the rule.- Specified by:
getMessageIdLong
in interfaceAutoModExecution
- Returns:
- The id of the message, or 0 if the message has been blocked
-
getAlertMessageIdLong
public long getAlertMessageIdLong()Description copied from interface:AutoModExecution
The id of the alertMessage
sent to the alert channel.- Specified by:
getAlertMessageIdLong
in interfaceAutoModExecution
- Returns:
- The id of the alert message, or 0 if
AutoModResponse.getType()
is notAutoModResponse.Type.SEND_ALERT_MESSAGE
-
getContent
Description copied from interface:AutoModExecution
The user content that triggered this rule.This is empty if
GatewayIntent.MESSAGE_CONTENT
is not enabled. However, you can still useAutoModExecution.getMatchedKeyword()
regardless.- Specified by:
getContent
in interfaceAutoModExecution
- Returns:
- The user content
-
getMatchedContent
Description copied from interface:AutoModExecution
The substring match of the user content that triggered this rule.This is empty if
GatewayIntent.MESSAGE_CONTENT
is not enabled. However, you can still useAutoModExecution.getMatchedKeyword()
regardless.- Specified by:
getMatchedContent
in interfaceAutoModExecution
- Returns:
- The user content substring
-
getMatchedKeyword
Description copied from interface:AutoModExecution
The keyword that was found in theAutoModExecution.getContent()
.- Specified by:
getMatchedKeyword
in interfaceAutoModExecution
- Returns:
- The keyword that was found in the content
-