Represents an action taken by an Auto Moderation rule.
Action Types
| Value | Name | Description |
|---|---|---|
| 1 | block_message | Block the message with optional custom response |
| 2 | send_alert | Send alert to a specified channel |
| 3 | timeout | Timeout the user (max 4 weeks) |
| 4 | block_member_interaction | Block member interactions in the guild |
Helper Constructors
EDA.AutoMod.Action.block_message()
EDA.AutoMod.Action.block_message("Custom blocked message")
EDA.AutoMod.Action.send_alert("channel_id")
EDA.AutoMod.Action.timeout(60)
EDA.AutoMod.Action.block_member_interaction()
Summary
Functions
Creates a block_member_interaction action (type 4).
Creates a block_message action (type 1) with no custom message.
Creates a block_message action (type 1) with a custom response message.
Converts a raw Discord action map into this struct.
Creates a send_alert action (type 2) targeting the given channel.
Creates a timeout action (type 3) with the given duration in seconds.
Converts this struct to a map for API serialization.
Types
@type t() :: %EDA.AutoMod.Action{ metadata: EDA.AutoMod.ActionMetadata.t() | nil, type: integer() | nil }
Functions
@spec block_member_interaction() :: t()
Creates a block_member_interaction action (type 4).
@spec block_message() :: t()
Creates a block_message action (type 1) with no custom message.
Creates a block_message action (type 1) with a custom response message.
Converts a raw Discord action map into this struct.
Creates a send_alert action (type 2) targeting the given channel.
Creates a timeout action (type 3) with the given duration in seconds.
Converts this struct to a map for API serialization.