GithubHelp home page GithubHelp logo

gorobot's Introduction

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 API

Docker

# 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:

./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).

gorobot's People

Contributors

aimxhaisse avatar moul avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.