Skip to content

Moderation

Tommaso Ornato edited this page Sep 7, 2023 · 17 revisions

Only moderators may set AutoMod rules and only for communities where they are a mod themselves.

Example:
Bob is a mod in c/memes. Bob is allowed to enable the AutoMod and set its rules in c/memes.
However Bob is NOT a moderator in c/general, so he won't be able to set any rules in that community.

Prerequisites

Before any AutoMod configuration rule can be submitted, the bot needs to be a moderator in the target community. As a pre-release measure, it will be necessary to manually comment on the target community from the AutoMod's account and manually appoint it as a moderator. This process will be automated in further releases.

Interacting with the bot

Interaction happens through Lemmy DMs, accessible through the "Send Message" button (not "Send Secure Message"!) on the bot's profile.

immagine

Configurations should be set up in the form of JSON objects. The content of the object will be discussed in the syntax paragraph.

Once an object containing one or more rules has been written, it should be pasted in the message box without any further formatting. The bot will then process it and reply to the message with either an error message or a confirmation. Error messages will be discussed in the error handling paragraph.

immagine

Syntax

The syntax of configurations follows a strict set of rules to unambiguously highlight what is a valid configuration and what isn't.

Currently, the AutoMod allows four configuration options:

  • comment.json, dictates the removal of comments
  • post.json, dictates the removal of posts
  • exception.json, lists exceptions to the two aforementioned rules
  • mention.json, describes commands available to the moderators to easily "pin" and "lock" posts

All rules include a rule field, detailing which of the four configuration options it represents
(can be one of "comment","post","exception",mention").

Each of these configurations has to follow a JSON schema, available in this repository. Various examples of valid configurations are also available in the lemmy-automoderator-examples repository.

Optionally, a $schema proprety might be added. This will add JSON schema support (automatic, real time validation) in code editors like Visual Studio Code, therefore this is the reccomended setup for writing new rules. An online editor is also available at this link (requires a GitHub account).

Multiple rules

Instead of inserting a single rule per message, it is also possible to send an array of JSON objects containing multiple rules in a single message.

A detailed guide on how to do so is available in the Inserting multiple rules page.