Actions Reference
This document provides an exhaustive list of all actions supported by Modegator's execution engine, along with the specific properties they accept.
Every action in an actions or fallback_actions array must specify a type. Depending on the type, other properties become required or optional.
Dynamic Placeholders
Modegator supports the interpolation of dynamic placeholders inside specific YAML string properties. This mechanism allows rules, UI actions, and scheduled tasks to personalize user interactions, construct context-specific keys for the Redis state engine, or dynamically target communication recipients at execution time.
Syntax Specification
Placeholders are evaluated using the double-curly-braces syntax:
{{ placeholder_name }}
During execution, if a property supports placeholder resolution, any matching patterns are replaced by their corresponding value derived from the triggering event's context.
Pipeline Filters
Resolved values can be modified prior to insertion by applying one or more pipeline filters. Filters are appended to the placeholder name separated by a pipe (|) character:
{{ placeholder_name | filter1 | filter2 }}
The execution engine supports the following formatting filters:
lowercase: Transforms all alphabetical characters in the value to lowercase (e.g.,{{author | lowercase}}resolvesYashArotetoyasharote).uppercase: Transforms all alphabetical characters in the value to uppercase (e.g.,{{subreddit | uppercase}}resolvesModegatortoMODEGATOR).trim: Strips leading and trailing whitespace characters from the value.
These filters can be chained sequentially in left-to-right order (e.g., {{post_title | trim | lowercase}}).
Supported Properties
The following action properties support dynamic placeholder interpolation:
| Property | Description | Example Target |
|---|---|---|
to | Recipient username for direct messages or modmail conversations. This field supports full placeholder resolution (e.g., targeting a post author dynamically via {{author}}). | to: "{{author}}" |
text | Markdown text content of submitted comments or modmail replies. | text: "Hi u/{{author}}, welcome!" |
subject | Subject line of private messages or modmail threads. | subject: "Alert regarding post: {{post_id}}" |
body | Main text body of private messages or modmail threads. | body: "Your post titled '{{post_title}}' was reviewed." |
reason | Internal ban reason logged in moderation history. | reason: "Repetitive posts by {{author}}" |
message | Ban notification message delivered to the banned user. | message: "You have been banned from r/{{subreddit}}." |
mod_note | Internal note attached to a user's subreddit ban record. | mod_note: "Banned on {{date}} at {{time}}" |
note | Text content of a Reddit-native moderator profile note. | note: "Solid contributor since {{date}}" |
key | Identifier key used in state management actions (store_value and increment_counter). | key: "user_warnings_{{author}}" |
domain | Target domain name for marking link domains. | domain: "{{post_domain}}" |
url | Destination URL for external HTTP webhook payloads. | url: "https://logs.example.com/webhook/{{subreddit}}" |
Variable Reference Index
The following table documents all available placeholder variables accessible within the execution environment:
| Variable | Data Type | Context Resolution |
|---|---|---|
{{author}} {{author_name}} | string | The Reddit username of the user who triggered the event. |
{{author_karma}} | number | The total numeric karma score of the triggering author. |
{{author_age_days}} | number | The age of the triggering author's account, measured in days. |
{{post_id}} | string | The unique Reddit ID of the associated post (e.g., t3_xyz123). |
{{post_title}} | string | The text title of the associated post. |
{{post_url}} | string | The canonical URL link of the associated post. |
{{post_domain}} | string | The domain name of the submitted link (if the post is a link post). |
{{post_flair}} | string | The current text value of the post's flair. |
{{comment_id}} | string | The unique Reddit ID of the associated comment (e.g., t1_abc456). |
{{comment_body}} | string | The text content of the comment (truncated to the first 500 characters). |
{{subreddit}} | string | The name of the subreddit where the event occurred. |
{{report_reason}} | string | The reason provided in the report (only available for report-triggered events). |
{{date}} | string | The current date in UTC, formatted as YYYY-MM-DD. |
{{time}} | string | The current time in UTC, formatted as HH:MM. |
Post Actions
These actions modify Reddit posts.
remove_post: Removes the target post.spam(boolean): Iftrue, flags the removal as spam in the spam filter (default:false).
approve_post: Approves the post, removing it from the spam filter/mod queue.lock_post: Locks the post to prevent new comments.unlock_post: Unlocks the post.set_post_flair: Applies flair to the post.flair_text(string): The plain text of the flair.flair_css_class(string): A CSS class from the subreddit stylesheet to apply to the flair.color(string, optional): The flair background color. Use a named color (red,orange,yellow,green,blue,gray) or a hex value (e.g.'#FF4500').text_color(string, optional): The flair text color. Either'dark'or'light'.
mark_post_nsfw: Marks the post as Not Safe For Work (NSFW).unmark_post_nsfw: Removes the NSFW tag.mark_post_spoiler: Marks the post as a spoiler.unmark_post_spoiler: Removes the spoiler tag.
Comment Actions
These actions modify Reddit comments.
remove_comment: Removes the target comment.spam(boolean): Iftrue, flags it as spam (default:false).
approve_comment: Approves the comment.lock_comment: Locks the comment to prevent replies.submit_comment: Replies to the target item (supports posts or comments).text(string): The body of the comment (supports placeholders).distinguish(boolean): Iftrue, distinguishes the comment as moderator-distinguished (default:false).sticky(boolean): Iftrueand replying to a post, stickies the comment to the top of the thread (default:false).
User Actions
These actions modify user permissions and flairs within the subreddit.
ban_user: Bans the author of the triggering event.duration(number |"permanent"): Ban duration in days or"permanent".reason(string): Internal ban reason logged in Mod Tools (supports placeholders).message(string): Ban notification message sent to the user (supports placeholders).mod_note(string): Internal mod note attached to the ban record (supports placeholders).
unban_user: Unbans the user.mute_user: Mutes the user in Modmail for 3 days.unmute_user: Unmutes the user in Modmail.set_user_flair: Sets the user's flair in the subreddit.flair_text(string): The plain text of the flair.flair_css_class(string, optional): A CSS class from the subreddit stylesheet.color(string, optional): The flair background color. Named color or hex value (seeset_post_flairabove).text_color(string, optional): Either'dark'or'light'.
clear_user_flair: Clears the user's flair.approve_user: Adds the user as an Approved Submitter.remove_approval: Removes Approved Submitter status.add_mod_note: Appends a Reddit native Mod Note to the user's profile.label(string, required): Must be one of the following exact strings:BOT_BANPERMA_BANBANABUSE_WARNINGSPAM_WARNINGSPAM_WATCHSOLID_CONTRIBUTORHELPFUL_USER
note(string, required): The text content of the note (supports placeholders).
Communication Actions
send_modmail(orsendmodmail): Sends a new Modmail conversation.to(string, optional): The target recipient. Defaults to the author of the triggering item. (Note: Must be explicitly provided if run from a Scheduled Task cron context).subject(string): The Modmail subject line (supports placeholders).body(string): The Modmail body text (supports placeholders).hidden(boolean): Iftrue, hides the moderator's username, sending it as the subreddit (default:false).
reply_modmail: Replies to the current Modmail thread. (Note: Only valid in rules triggered byModMailevent).text(string): The reply content (supports placeholders).internal(boolean): Iftrue, posts the reply as a private Moderator Note inside the modmail thread instead of sending it to the user (default:false).hidden(boolean): Hides the moderator's username (default:false).
send_private_message: Sends a direct private message.to(string, optional): Recipient username. Defaults to the event author. (Note: Required in Scheduled Task cron contexts).subject(string): The message subject (supports placeholders).body(string): The message body (supports placeholders).
send_webhook: Sends a payload to an external HTTP webhook.url(string): The full target webhook URL (e.g.,https://discord.com/api/webhooks/...).message(string, optional): The simple text message payload. If provided without a custom payload, Modegator automatically formats it to match both Discord and Slack JSON specs ({"content": "...", "text": "..."}).headers(object, optional): A dictionary of custom HTTP headers to pass along (e.g.,Authorization: "Bearer {{custom_token}}"). Supports deep placeholder interpolation.payload(object, optional): A custom raw JSON payload to send in the HTTP body (e.g., custom Discord Embeds). Fully overrides the defaultmessageformatting. Supports deep placeholder interpolation.- Note: Target domains must be whitelisted under
permissions.http.domainsin yourdevvit.jsonfile and approved by Reddit Admins.
State & Storage Actions
These actions are useful for tracking data across events.
store_value: Saves a persistent key-value string in Redis.key(string): The key to write to (creates a database entry under your custom key name).value(string): The text to store.
increment_counter: Increments a Redis counter by 1.key(string): The key of the counter (creates a database counter entry under your custom key name).
tag_domain: Tags a link domain with a visual tag in the dashboard.domain(string): The target domain (e.g.example.com). Supports placeholders (e.g.{{post_domain}}).tag(string): The text tag to assign (e.g.Spam Site,Under Review).
Control Flow Actions
run_macro: Evaluates a predefined macro.macro(string): The name of the macro.
if: Conditionally executes a nested block of actions.conditions(array): An array of logical conditions to evaluate.then(array): An array of actions to execute if the conditions evaluate totrue.
stop_if: Halts further execution in the current action sequence (Rule, UI Action, Macro, or Scheduler).conditions(array, optional): An array of logical conditions (supportsany_of,all_of, etc.). Execution only halts if these conditions evaluate to true. If omitted, execution halts unconditionally.
delay: Pauses execution.duration_ms(number): Milliseconds to wait before executing subsequent actions.