descriptionnone
repository URLhttps://github.com/rofl0r/jsbot.git
ownerretnyg@gmx.net
last changeFri, 12 Apr 2019 23:58:24 +0000 (13 00:58 +0100)
last refreshSat, 27 Apr 2024 09:26:29 +0000 (27 11:26 +0200)
content tags
add:
README.md

jsbot - an efficient javascript IRC bot

this is a very space- and memory-efficient javascript IRC bot. the core is written in C and uses mujs as a tiny javascript interpreter, and rocksock as a very efficient network socket implementation with SSL support. a static linked binary is about 350 KB, if it was linked against musl libc, and rocksock was built against wolfssl.

usage

in order to use the ircbot, you need a config file:

#comment
host1=chat.freenode.net
host2=kornbluth.freenode.net
port=6697
ssl=1
nick1=mybot
nick2=mybot_
proxy=socks4://127.0.0.1:9050
savefile=mybot.json

then start the bot like ./jsbot mybot.cfg. you also need a file ircbot.js that implements the callbacks the C code tries to call. look at the provided example to see how it works. the bot saves its settings into the filename you provide as savefile in the config, when it calls its writesettings() callback.

compilation

cd /tmp
mkdir jsbot-0000
cd jsbot-0000/
git clone https://github.com/rofl0r/jsbot
git clone https://github.com/rofl0r/rocksock
git clone https://github.com/rofl0r/rcb2
export PATH=$PATH:/tmp/jsbot-0000/rcb2
ln -s /tmp/jsbot-0000/rcb2/rcb2.py /tmp/jsbot-0000/rcb2/rcb2
cd jsbot

#you may edit config.mak to override settings from Makefile
#nano config.mak

make

alternative compilation method

if you don't want to use the above method, for example because you don't have perl, you can compile and install rocksock the standard way (./configure && make && make install), then compile rocksock's rsirc.c gcc -c rocksockirc/rsirc.c then compile jsbot.c gcc jsbot.c rocksockirc/rsirc.o -lrocksock -lmujs -o jsbot. this is to give you an idea what needs to be done, it may work slightly different in your case.

the code within this project is licensed under the GNU GPLv2 or later. the mujs library on which it depends is licensed under the GNU AGPLv3. due to the viral nature of the licences, this means that complete project (and hence any binary distributed versions) are covered by the GNU AGPL, rather than the less restrictive GNU GPL.

shortlog
2019-04-12 rofl0rswitch to RcB2 build sysmaster
2018-03-30 rofl0radd a no-activity timeout preventing bot from getting...
2017-01-24 rofl0rREADME.md: clarify license situation
2017-01-21 rofl0rfix 2 potential vulns with rogue IRC servers
2017-01-20 rofl0rREADME: fix typo
2017-01-20 rofl0rREADME.md: fix markup for hyperlinks
2017-01-20 rofl0radd ircbot javascript code
2017-01-20 rofl0radd README.md
2017-01-20 rofl0rjsbot: handle also nick changes
2017-01-20 rofl0rdispatch end of names command also via generic mechanism
2017-01-20 rofl0radd support for names list (353) via nameshandler()
2017-01-20 rofl0rcall kickhandler hook as well
2017-01-20 rofl0rremove boilerplate js callback wrapper funcs
2017-01-20 rofl0rfix parthandler optional message handling
2017-01-20 rofl0rimprove split() to return useful result if fewer items...
2017-01-20 rofl0ruse a central dispatch function for received messages
...
heads
5 years ago master