Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aimxhaisse/gorobot
IRC bot written in Go
https://github.com/aimxhaisse/gorobot
Last synced: 24 days ago
JSON representation
IRC bot written in Go
- Host: GitHub
- URL: https://github.com/aimxhaisse/gorobot
- Owner: aimxhaisse
- Created: 2011-01-26T08:58:43.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2015-05-06T21:30:08.000Z (over 9 years ago)
- Last Synced: 2024-05-02T00:16:52.552Z (7 months ago)
- Language: Go
- Homepage:
- Size: 604 KB
- Stars: 13
- Watchers: 6
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
GoRobot
===Yet Another IRC robot.
## Features:
* 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 APIDocker
------# 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
Extending with Docker
---------------------FROM aimxhaisse/gorobot
ADD . ./root
...## Commands
### How it works
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).### Available commands
Private: !spoon
Public: !chat !non !pokemon !roulette !viewquote !ninja !fax !pwet !boby !matrix !oui !template !statquote ...
Admin: !addquote !join !kick !part
### How to add new commands
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:```sh
./bin/scripts/xxx/yyy.cmd <...>
```Example, "UserA" invokes "!hejsan 42" on the channel #toto42 of freenode:
```sh
./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:
```sh
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:
```sh
#!/usr/bin/env bashport=$1
serv=$2
chan=$3
user=$4echo "$serv 1 PRIVMSG $user :th3r3 1s n0 sp0on..." | nc localhost $po
```Once the command is created, don't forget to chmod it (+x).