3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-30 16:09:27 +01:00

add shizzle

This commit is contained in:
Douglas Gardner 2013-03-06 16:34:59 +00:00
parent 1082ea65d4
commit 184d70d3a7
3 changed files with 20 additions and 5 deletions

12
modules/rc/README.md Normal file
View File

@ -0,0 +1,12 @@
# RC
Prints UDP packets; designed for a MediaWiki installation.
# Configuration
## server
The server name, as configured in the main ``config.json``, that depressionbot will announce packets from.
## channel
The channel name, that depressionbot will announce packets from.
## port
The port depressionbot will listen for UDP packets on.
## address
The address depressionbot will allow UDP packets from. UDP packets sent from a different address will be ignored.

View File

@ -1,3 +1,6 @@
{
"port":1337
"port":14628,
"address": "127.0.0.1",
"server": "freenode",
"channel": "#zuzak2"
}

View File

@ -7,13 +7,13 @@ var dgram = require('dgram');
var rc = function(dbot) {
var server = dgram.createSocket("udp4");
server.on("message", function(msg, rinfo) {
server.on("message", function(msg, msginfo) {
var message = msg.toString();
console.log(message);
// dbot.say(dbot.config.rc.server, dbot.config.rc.channel, message);
if (msginfo.address == dbot.config.rc.address) {
dbot.say(dbot.config.rc.server, dbot.config.rc.channel, message);
}
});
server.bind(dbot.config.rc.port);
};