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
ConstructorsConstructorDescriptionAutoModExecutionEvent(JDA api, long responseNumber, AutoModExecution execution) -
Method Summary
Modifier and TypeMethodDescriptionlongThe id of the alertMessagesent to the alert channel.TheGuildMessageChannelUnionthat this execution occurred in.The user content that triggered this rule.getGuild()TheGuildthat this execution occurred in.The substring match of the user content that triggered this rule.The keyword that was found in theAutoModExecution.getContent().longThe id of theMessagewhich triggered the rule.TheAutoModResponsethat has been triggered by this execution.longThe id of theAutoModRulewhich has been triggered.TheAutoModTriggerTypefor the execution.longThe id of the user that triggered this execution.Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getRawData, getResponseNumber, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:AutoModExecutionTheGuildthat this execution occurred in.- Specified by:
getGuildin interfaceAutoModExecution- Returns:
- The
Guild
-
getChannel
Description copied from interface:AutoModExecutionTheGuildMessageChannelUnionthat this execution occurred in.This might be
nullif the execution occurred by future event types.- Specified by:
getChannelin interfaceAutoModExecution- Returns:
- The
GuildMessageChannelUnion
-
getResponse
Description copied from interface:AutoModExecutionTheAutoModResponsethat has been triggered by this execution.- Specified by:
getResponsein interfaceAutoModExecution- Returns:
- The
AutoModResponse
-
getTriggerType
Description copied from interface:AutoModExecutionTheAutoModTriggerTypefor the execution.- Specified by:
getTriggerTypein interfaceAutoModExecution- Returns:
- The
AutoModTriggerType
-
getUserIdLong
public long getUserIdLong()Description copied from interface:AutoModExecutionThe id of the user that triggered this execution.- Specified by:
getUserIdLongin interfaceAutoModExecution- Returns:
- The id of the user
-
getRuleIdLong
public long getRuleIdLong()Description copied from interface:AutoModExecutionThe id of theAutoModRulewhich has been triggered.- Specified by:
getRuleIdLongin interfaceAutoModExecution- Returns:
- The id of the rule
-
getMessageIdLong
public long getMessageIdLong()Description copied from interface:AutoModExecutionThe id of theMessagewhich triggered the rule.- Specified by:
getMessageIdLongin interfaceAutoModExecution- Returns:
- The id of the message, or 0 if the message has been blocked
-
getAlertMessageIdLong
public long getAlertMessageIdLong()Description copied from interface:AutoModExecutionThe id of the alertMessagesent to the alert channel.- Specified by:
getAlertMessageIdLongin interfaceAutoModExecution- Returns:
- The id of the alert message, or 0 if
AutoModResponse.getType()is notAutoModResponse.Type.SEND_ALERT_MESSAGE
-
getContent
Description copied from interface:AutoModExecutionThe user content that triggered this rule.This is empty if
GatewayIntent.MESSAGE_CONTENTis not enabled. However, you can still useAutoModExecution.getMatchedKeyword()regardless.- Specified by:
getContentin interfaceAutoModExecution- Returns:
- The user content
-
getMatchedContent
Description copied from interface:AutoModExecutionThe substring match of the user content that triggered this rule.This is empty if
GatewayIntent.MESSAGE_CONTENTis not enabled. However, you can still useAutoModExecution.getMatchedKeyword()regardless.- Specified by:
getMatchedContentin interfaceAutoModExecution- Returns:
- The user content substring
-
getMatchedKeyword
Description copied from interface:AutoModExecutionThe keyword that was found in theAutoModExecution.getContent().- Specified by:
getMatchedKeywordin interfaceAutoModExecution- Returns:
- The keyword that was found in the content
-