From d958a2135de0aafa38acb8717e763625b975c416 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 8 Jan 2023 21:45:58 +0100 Subject: [PATCH] Updated documentation --- README.md | 14 +++++++++++--- src/bot.rs | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d71c82b..f9bef1d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Matrix Modbot is a bot for Matrix used to automatically moderate Matrix rooms. ## Who is this bot for? -The bot is orientated towards admins of large Matrix rooms that are public and require constant moderation. With this bot, simple jobs such as swear filtering and spam prevention could be accomplished without intervention of human moderators. +The bot is orientated towards admins of large Matrix rooms that are public and require constant moderation. With this bot, simple jobs such as swear filtering and spam prevention could be accomplished without intervention of human moderators. This project is still a work in progress, please feel free to PR and create issues if you find any. ## How to run? @@ -12,21 +12,29 @@ The bot is orientated towards admins of large Matrix rooms that are public and r A minimal Docker image containing the compiled binary is published on [Docker Hub](https://hub.docker.com/r/davidlocalhost/matrix-modbot). Note that this image is automatically pushed using a CI/CD Pipeline for every commit made to the main branch. Expect there to be bugs and breaking changes. `sudo docker run -v /local/path/to/config.ini:/config.ini -t matrix-modbot:latest` +Without root: +`docker run -v /local/path/to/config.ini:/config.ini -t matrix-modbot:latest` + **Using Cargo:** ``` cargo build --release cargo run /path/to/config.ini ``` +Note that this bot will NOT run in an encrypted room. It also can only join 1 room at a time and isn't integrated with Element's Spaces feature. You must specify the room to join in the config file and invite the bot. You will also have to create an account for the bot and put the credentials into the config file. + +### Configuration +For configuration, see `example_config.ini`. The options should be self-explanatory. + ## Features - Easy to configure - Configurable swear detection -- Spam detection +- Spam detection (WIP) - Anti-Caps - Reputation system - All members of a room have reputation points, they are deducted when spam/swear/caps are detected - - Automatically kicks a member if reputation is too low + - Automatically kicks a member if reputation is below -15 - Members can award each other with maximum 1 reputation point every 24hr - Users with power level >= 50 are not affected (Mods and Admins) diff --git a/src/bot.rs b/src/bot.rs index 059c7c5..b7d2881 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -391,6 +391,7 @@ pub mod bot { .get(author.user_id().as_str()) .unwrap() .unwrap()); + let (_, reputation) = convert_from_bytes_sled(&user_data); self.send_message( format!("Your current reputation is: {}", reputation).as_str(),