aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 339f5099b6f0492cddb97e9133171e83d2ab9da3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
sircbot
=======

a small IRC bot for use with git hooks, cronjobs, scripts etc


Compile
-------

To build sircbot you need a C compiler and GNU make. To build the lua
module you need Lua 5.1, 5.2 or 5.3.

To compile sircbot run:

    make


You can set various compile options in config.mk:

    CFLAGS=-Os
    LUA_VERSION=5.2


Running the server
------------------

start the server with:

    sircbot -s SERVER -n NICK '#channel1' '#channel2'

It connects to server and joins given channels. When a channel is joined
it creates a unix socket /var/run/sircbot/<#channel> which can connected to
with sircbot-send.


Sending messages
----------------

To send to a connected channel use:

    echo "$message" | sircbot-send '#channel1'

sircbot-send will send everything from stdin to given channel.

For every message that goes to the channel, sircbot will run all scripts in
/etc/sircbot.d/<#channel>/ with sender, message and channel name as arguments.


Sending message with Lua
------------------------

Example script which explains how to send a message with Lua

    local sircbot = require('sircbot')
    local client = sircbot.connect('#channel')

    client:send("hello")