1
0
Fork
You've already forked rollbot-mastodon
0
Utilizes RPG Dice Roller as a lightweight mastodon bot in PHP and Node.js https://rollbot.dnddeutsch.de/
  • JavaScript 66.4%
  • PHP 22.6%
  • Python 5%
  • CSS 4.1%
  • HTML 1.9%
2026年07月10日 14:52:31 +02:00
bot new fluxer-bot 2026年07月07日 23:04:47 +02:00
fluxer-bot moved to own repository 2026年07月10日 14:52:31 +02:00
pixels howto.html was moved to web/pixels.html before 2024年11月15日 12:15:42 +01:00
server updated error handling 2026年07月10日 10:57:54 +02:00
web updated input filter and error handling 2026年07月10日 10:47:05 +02:00
.gitignore new fluxer-bot 2026年07月07日 23:04:47 +02:00
config.sample.php move reply.php to bot/bot.php and restructure accordingly; added font-awesome 2023年05月27日 11:36:53 +02:00
README.md rollbot-web description 2023年05月30日 15:23:31 +02:00
rollbot-pixels.service.sample new: Pixels interface 2024年11月15日 12:12:32 +01:00
rollbot.service.sample restructure 2023年05月24日 22:01:12 +02:00

rollbot

Utilizes RPG Dice Roller as a lightweight mastodon bot in PHP and Node.js

Installation

  • Setup a mastodon app on DOMAIN and get an ACCESS_TOKEN
  • Setup a MySQL database
  • Choose a port for server.js
  • you'll need composer, node and npm
git clone $REPOSITORY
chown -R www-data.www-data $REPOSITORY_DIR

rollbot-bot

cd bot
composer install

rollbot-server

cd server
npm install

rollbot-web

this is the code of https://rollbot.dnddeutsch.de. Feel free to copy and modify as needed

Dice-Roller CLI (optional)

npm install -g @dice-roller/cli

bot uses roller as fallback, when server.js doesn't respond

Configuration

config.php

cp config.sample.php bot/config.php
ln -s bot/config.php web/config.php

Set $config values for mastodon, database and server.js in bot/config.php

export ROLLBOT_HOST=$HOST
export ROLLBOT_PORT=$PORT

Use HOST and PORT from $config['server.js']

Usage

node server/server.js
php bot/bot.php

run bot.php via cron and make server.js permanent (e.g. with systemd, see rollbot.service.sample)

Test

curl http://$HOST:$PORT?2d20

Should output something like 2d20: [8, 13] = 21