FoxxMD / context-mod

an event-based, reddit moderation bot built on top of snoowrap and written in typescript
https://contextmod.dev
MIT License
49 stars 11 forks source link
bot reddit reddit-application reddit-bot typescript

title: Home nav_order: 1

ContextMod Latest Release License: MIT Docker Pulls

<img src="/docs/logo.png" align="right" alt="ContextMod logo" width="180" height="176">

Context Mod (CM) is an event-based, reddit moderation bot built on top of snoowrap and written in typescript.

It is designed to help fill in the gaps for automoderator in regard to more complex behavior with a focus on user-history based moderation.

An example of the above that Context Bot can do:

  • On a new submission, check if the user has also posted the same link in N number of other subreddits within a timeframe/# of posts
  • On a new submission or comment, check if the user has had any activity (sub/comment) in N set of subreddits within a timeframe/# of posts

In either instance Context Bot can then perform any action a moderator can (comment, report, remove, lock, etc...) against that user, comment, or submission.

Feature Highlights for Moderators:

Feature highlights for Developers and Hosting (Operators):

Table of Contents

How It Works

Each subreddit using the RCB bot configures its behavior via their own wiki page.

When a monitored Activity (new comment/submission, new modqueue item, etc.) is detected the bot runs through a list of Checks to determine what to do with the Activity from that Event. Each Check consists of :

Kind

Is this check for a submission or comment?

Rules

A list of Rules to run against the Activity. Triggered Rules can cause the whole Check to trigger and run its Actions

Actions

A list of Actions that describe what the bot should do with the Activity or Author of the activity (comment, remove, approve, etc.). The bot will run all Actions in this list.


The Checks for a subreddit are split up into Submission Checks and Comment Checks based on their kind. Each list of checks is run independently based on when events happen (submission or comment).

When an Event occurs all Checks of that type are run in the order they were listed in the configuration. When one check is triggered (an Action is performed) the remaining checks will not be run.


Learn more about the RCB lifecycle and core concepts in the docs.

Getting Started

Operators

This guide is for users who want to run their own bot on a ContextMod instance.

See the Operator's Getting Started Guide

Moderators

This guide is for reddit moderators who want to configure an existing CM bot to run on their subreddit.

See the Moderator's Getting Started Guide

Configuration and Documentation

Context Bot's configuration can be written in YAML (like automoderator) or JSON5. Its schema conforms to JSON Schema Draft 7. Additionally, many operator settings can be passed via command line or environmental variables.

Check the full docs for in-depth explanations of all concepts and examples

Web UI and Screenshots

Dashboard

CM comes equipped with a dashboard designed for use by both moderators and bot operators.

Subreddit View

Bot Setup/Authentication

A bot oauth helper allows operators to define oauth credentials/permissions and then generate unique, one-time invite links that allow moderators to authenticate their own bots without operator assistance. Learn more about using the oauth helper.

Operator view/invite link generation:

Oauth View

Moderator view/invite and authorization:

Invite View

A similar helper and invitation experience is available for adding subreddits to an existing bot.

Subreddit Invite View

Configuration Editor

A built-in editor using monaco-editor makes editing configurations easy:

Configuration View

Grafana Dashboard

Grafana Dashboard

License

MIT