Yet Another IRC robot.
- Multiple servers, multiple channels, conversations, flood control
- Administration via a specific set of IRC channels
- JSON configuration
- Module to handle shell scripts, through a tiny API
# Build
docker build -t aimxhaisse/gorobot .
# Run in foreground
docker run -i -t -rm aimxhaisse/gorobot
# Run in background
docker run -d aimxhaisse/gorobot
# Mounts scripts directory for dev
docker run -i -t -rm \
-v $(pwd)/root/ /home/gorobot/gorobot/root/ \
aimxhaisse/gorobot
FROM aimxhaisse/gorobot
ADD . ./root
...
Commands can be added in folders scripts/{admin,public,private}.
- Private commands are executed when talking in private with the bot.
- Public commands are executed on all channels.
- Admin commands are executed on master channels (see grobot.json).
Private: !spoon
Public: !chat !non !pokemon !roulette !viewquote !ninja !fax !pwet !boby !matrix !oui !template !statquote ...
Admin: !addquote !join !kick !part
You can add new commands in whatever language you want. Current ones are in PHP or Lua (with some helpers to do the dirty job). Commands are executed like this:
./bin/scripts/xxx/yyy.cmd <port> <server> <channel> <user> <param1> <param2> <...>
Example, "UserA" invokes "!hejsan 42" on the channel #toto42 of freenode:
./bin/scripts/xxx/yyy.cmd 2345 freenode #toto42 UserA 42
The port is a local port opened by the module "scripts", it accepts raw IRC commands in the following way:
<server> <priority> RAW_COMMAND
Server is the server where the command has to be executed, priority is a number (1, 2 or 3) indicating the priority of the command. This priority is meaningful on servers having flood control (you may want to kick someone before printing 42 lines).
Example of a bash command:
#!/usr/bin/env bash
port=$1
serv=$2
chan=$3
user=$4
echo "$serv 1 PRIVMSG $user :th3r3 1s n0 sp0on..." | nc localhost $po
Once the command is created, don't forget to chmod it (+x).