An IRC bot for #pr0k, written in node, using Redis.
- npm install:
npm install pr0kbot
- Modify
config.json
to your desire. - Run server:
node run
Pass an argument to run
for separate configuration file.
Modify configuration in config.json
-
network
Desired network, e.g.irc.synirc.net
-
port
Port, e.g.6667
-
nick_name
Desired nick, e.g.blazerboy420
-
user_name
Desired username, e.g.blazer
-
real_name
Desired real name, e.g.Chauncey Biggums
-
autojoin
List of channels to autojoin, e.g.[ '#mychannel' ]
-
log
Whether or not to log input / output. Option may be booleantrue / false
or a stringin / out
.
-
write
Writes raw commands to the server -
msg
Sends PRIVMSG to channel or user -
notice
Sends NOTICE to channel or user -
join
Joins channel
You may listen for any of these events. Also support for arbitrary modes, defined +mode -mode e.g. +v
connect
notice
server notice
channel notice
join
part
quit
msg
server msg
channel msg
mode
channel mode
user mode
mute
unmute
inviteonly
deinviteonly
voice
devoice
halfop
dehalfop
op
deop
ban
unban
pr0kbot automatically loads modules from the /modules
directory. There are two very simple module formats. For an example, see the default ping
module.
module.exports = {
event1:function() {
/* handle event */
},
event2:function() {
/* handle event */
}
};
And the more liberal:
module.exports = function(con) {
this.on('event1', function() {
/* handle event */
})
this.on('event2', function() {
/* handle event */
})
}