/spam-police

A matrix bot to monitor and respond to investment scam spamming across the matrix platform, for example in rooms with a permanently offline admin.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Spam Police

A Matrix bot to monitor and respond to investment scam spamming across the Matrix platform, for example in rooms with a permanently offline admin.

Warning

This bot does not support encrypted rooms yet

Discussion

Inviting the bot

You can use my instance: @anti-spam:matrix.org, or self-host your own!

To invite it, you can run the command below in #anti-scam-cmds:matrix.org.

+invite [Alias/ID to room]

Note

If you have problems inviting the bot, make sure the bot can join it. If you still have problems, join our support room.

Note

My instance logs the scams it finds to #jjj-tg-scams:matrix.org

Self-hosting

Requirements

Note

The bot is very light during run time and barely uses any resources, however it sees a large resource spike at startup due to initial sync. This can cause it to crash on lower powered systems (like the hetzner cpx11 vps) if you have an old sync token. What I do to fix this is I run the bot on a higher powered system like my dev machine, and then copy that sync token in bot.json into the bot.json on my vps. Please let me know or contribute if you know how to make the initial sync less resource intense.

Instructions

  1. Download the latest stable version located in the branches
    • Stable branches are formatted as stable-vX.X.X-(version-X,-minor-release-X)
    • Downloading as a ZIP and extracting it is recommended
      • Using git: git clone -b <branch> --single-branch https://github.com/archeite/spam-police.git

Note

For a development version, you download from the master branch instead of the stable branch. The git command is shown below

$ git clone -b master --single-branch https://github.com/archeite/spam-police.git
  1. Go into the folder you cloned (cd spam-police), create a directory named db (mkdir -p db), and enter it (cd db)
cd spam-police && mkdir -p db && cd db
  1. Copy the example configuration file from examples/login.yaml to db (cp ../examples/login.yaml ./)

  2. Edit the configuration file to your liking

  3. Go back to the root directory (cd ..) and create bot.json (touch bot.json)

Note

You don't need to put anything in bot.json, leave it empty

This appears to be how the bot SDK saves the sync token and stuff, however it seems to work just fine if I delete this so maybe the code could be changed around to not require it?

  1. To install dependencies, run npm install

  2. Start the bot with node index.js or node .