Root definitions

MessageActionJson

Permalink

Send a private message to the Author of the Activity.

Properties

asSubreddit Required

boolean

Should this message be sent from modmail (as the subreddit) or as the bot user?

authorIs

anyOf [Array<anyOf [AuthorCriteria, NamedCriteria<AuthorCriteria>, string]>, FilterOptionsJson<AuthorCriteria>]

If present then these Author criteria are checked before running the Check. If criteria fails then the Check will fail.

content Required

string

The Content to submit for this Action. Content is interpreted as reddit-flavored Markdown.

If value starts with wiki: then the proceeding value will be used to get a wiki page from the current subreddit

  • EX wiki:botconfig/mybot tries to get https://reddit.com/r/currentSubreddit/wiki/botconfig/mybot

If the value starts with wiki: and ends with |someValue then someValue will be used as the base subreddit for the wiki page

  • EX wiki:replytemplates/test|ContextModBot tries to get https://reddit.com/r/ContextModBot/wiki/replytemplates/test

If the value starts with url: then the value is fetched as an external url and expects raw text returned

  • EX url:https://pastebin.com/raw/38qfL7mL tries to get the text response of https://pastebin.com/raw/38qfL7mL

If none of the above is used the value is treated as the raw context

  • EX this is **bold** markdown text => "this is bold markdown text"

All Content is rendered using mustache to enable Action Templating.

The following properties are always available in the template (view individual Rules to see rule-specific template data):

Copy
1 2 3 4 5 6 item.kind => The type of Activity that was checked (comment/submission) item.author => The name of the Author of the Activity EX FoxxMD item.permalink => A permalink URL to the Activity EX https://reddit.com/r/yourSub/comments/o1h0i0/title_name/1v3b7x item.url => If the Activity is Link Sumbission then the external URL item.title => If the Activity is a Submission then the title of that Submission rules => An object containing RuleResults of all the rules run for this check. See Action Templating for more details on naming
dryRun

boolean

If true the Action will not make the API request to Reddit to perform its action.

Default: false
enable

boolean

If set to false the Action will not be run

Default: true
footer

anyOf [boolean, string]

Customize the footer for Actions that send replies (Comment/Ban)

If false no footer is appended

If string the value is rendered as markdown or will use wiki: parser the same way content properties on Actions are rendered with templating.

If footer is undefined (not set) the default footer will be used:


This action was performed by [a bot.] Mention a moderator or [send a modmail] if you any ideas, questions, or concerns about this action.


The following properties are available for templating:

Copy
1 2 3 4 subName => name of subreddit Action was performed in (EX 'mealtimevideos') permaLink => The permalink for the Activity the Action was performed on EX https://reddit.com/r/yourSub/comments/o1h0i0/title_name/1v3b7x modmaiLink => An encoded URL that will open a new message to your subreddit with the Action permalink appended to the body botLink => A permalink to the FAQ for this bot.

If you use your own footer or no footer please link back to the bot FAQ using the {{botLink}} property in your content :)

itemIs

anyOf [Array<anyOf [SubmissionState, CommentState, NamedCriteria<TypedActivityState>, string]>, FilterOptionsJson<TypedActivityState>]

A list of criteria to test the state of the Activity against before running the check.

If any set of criteria passes the Check will be run. If the criteria fails then the Check will fail.

  • @examples [[{"over_18": true, "removed': false}]]
kind Required

string

The type of action that will be performed

Valid values: message

name

string

An optional, but highly recommended, friendly name for this Action. If not present will default to kind.

Can only contain letters, numbers, underscore, spaces, and dashes

Pattern: ^[a-zA-Z]([\w -]*[\w])?$
title

string

The title of the message

If not specified will be defaulted to Concerning your [Submission/Comment]

to

string

Entity to send message to. It can be templated.

If not present Message be will sent to the Author of the Activity being checked.

Valid formats:

  • aUserName -- send to /u/aUserName
  • u/aUserName -- send to /u/aUserName
  • r/aSubreddit -- sent to modmail of /r/aSubreddit

Note: Reddit does not support sending a message AS a subreddit TO another subreddit

Tip: To send a message to the subreddit of the Activity us to: 'r/{{item.subreddit}}'

Loading...

Editor and Validator