Mastodon group bot which reposts toots
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
fade 8b3296fedf update features 4 weeks ago
services add duplicate protection 1 month ago
.gitignore add logging 1 month ago
README.md update features 4 weeks ago
bot.go bug fix 4 weeks ago
cleaning.go bug fix 4 weeks ago
config.go add notification cleaning 4 weeks ago
config.json add notification cleaning 4 weeks ago
limits.go add notification cleaning 4 weeks ago
logger.go add notification cleaning 4 weeks ago
main.go bug fix 4 weeks ago
utils.go bug fix 4 weeks ago

README.md

Mastodon group bot

This is a bot which implements group functionality in Mastodon.

Features

  • Repost toots
  • Welcome message of new members
  • Limit of toots per hour
  • Duplicate protection
  • Order limit
  • Notification cleaning
  • Logging
  • Admin commands

Admin commands

  • unboost <Toot ID>
  • delete <Toot ID>

Configuration

The bot is configured in a JSON file that looks like this:

{
    "Server":               "https://example.com",
    "ClientID":             "0000000000000000000000000000000000000000000",
    "ClientSecret":         "0000000000000000000000000000000000000000000",
    "AccessToken":          "0000000000000000000000000000000000000000000",
    "WelcomeMessage":       "We have a new member in our group. Please love and favor",
    "NotFollowedMessage":   "you are not followed",
    "Max_toots":            2,
    "Toots_interval":       12,
    "Duplicate_buf":        10,
    "Order_limit":          1,
    "Del_notices_interval": 30,
    "Admins":               ["admin@example.com"]
}

Building

go mod init mastodon-group-bot
go mod tidy
go build

Setup services

For first make dirs, copy config and binary

mkdir /etc/mastodon-group-bot
mkdir /var/lib/mastodon-group-bot
mkdir /var/log/mastodon-group-bot
chown nobody /var/lib/mastodon-group-bot
chown nobody /var/log/mastodon-group-bot
cp config.json /etc/mastodon-group-bot/config.json
cp mastodon-group-bot /usr/bin/mastodon-group-bot

Systemd

cp ./services/systemd/mastodon-group-bot.service /etc/systemd/system/mastodon-group-bot.service

OpenRC

cp ./services/openrc/mastodon-group-bot /etc/init.d/mastodon-group-bot

Usage

mastodon-group-bot -config <path> -db <path> -log <path>