1
Fork 0
mirror of https://codeberg.org/nexy7574/matrix-autopin.git synced 2026-11-03 14:16:43 +00:00
  • Python 98.6%
  • Dockerfile 1.4%
Find a file
2024-11-04 02:01:33 +00:00
.forgejo/workflows Use SQL instead of redis 2024-11-01 17:22:08 +00:00
src Add a backlog worker 2024-11-04 02:01:33 +00:00
.gitignore Initial commit 2024-10-09 18:36:19 +01:00
config.example.json Initial commit 2024-10-09 18:36:19 +01:00
Dockerfile Initial commit 2024-10-09 18:36:19 +01:00
LICENSE Initial commit 2024-10-09 18:36:19 +01:00
README.md Initial commit 2024-10-09 18:36:19 +01:00
requirements.txt Use SQL instead of redis 2024-11-01 17:22:08 +00:00

AutoPin bot

A niobot that automatically pins messages in a channel when x number of reactions are added to it.

Usage

  1. Invite the bot to your room. There is a publicly hosted one, @autopin:nexy7574.co.uk, however you probably want to host your own
  2. Give it whatever power level you have configured that allows message pinning
  3. Run !!set-threshold <number> (e.g. !!set-threshold 5) in the room you want to use it in
  4. Get <number> 📌 reactions on a message
  5. The bot will automatically pin the message

Installing

Docker

services:
    redis:
        image: redis
        restart: always
        volumes:
            - ./redis:/data
    autopin:
        image: codeberg.org/nexy7574/autopin:latest
        restart: always
        volumes:
            - ./config.json:/app/config.json:ro
        depends_on:
            - redis

Make sure you make sure you have the following in your config.json:

{
    "redis": {
        "host": "redis"
    }
}

Manual

  1. Clone the repository
  2. Run python3 -m venv venv and source ./venv/bin/activate
  3. Run pip install -r requirements.txt
  4. Make sure redis is installed, and active
  5. Edit your config.json
  6. Run python3 src/main.py