Root definitions

CommentActionJson

Permalink

Reply to the Activity. For a submission the reply will be a top-level comment.

Properties

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
distinguish

boolean

Distinguish the comment after creation?

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: comment

lock

boolean

Lock the comment after creation?

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])?$
sticky

boolean

Stick the comment after creation?

targets

anyOf [Array<string>, string]

Specify where this comment should be made

Valid values: 'self' | 'parent' | [reddit permalink]

'self' and 'parent' are special targets that are relative to the Activity being processed:

  • When Activity is Submission => 'parent' does nothing
  • When Activity is Comment
    • 'self' => reply to Activity
    • 'parent' => make a top-level comment in the Submission the Comment is in

If target is not self/parent then CM assumes the value is a reddit permalink and will attempt to make a comment to that Activity

Loading...

Editor and Validator