3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-23 20:39:25 +01:00
dbot/modules/rc/rc.js

23 lines
532 B
JavaScript
Raw Normal View History

2013-03-06 14:55:35 +01:00
/**
2013-03-06 15:17:24 +01:00
* Module Name: RC
* Description: Relays UDP packets, intended for
* a feed of RecentChanges on a MediaWiki install.
2013-03-06 14:55:35 +01:00
*/
var dgram = require('dgram');
var rc = function(dbot) {
var server = dgram.createSocket("udp4");
server.on("message", function(msg, rinfo) {
2013-03-06 15:17:24 +01:00
var message = msg.toString();
2013-03-06 15:18:43 +01:00
console.log(message);
2013-03-06 15:17:24 +01:00
// dbot.say(dbot.config.rc.server, dbot.config.rc.channel, message);
2013-03-06 14:55:35 +01:00
});
server.bind(dbot.config.rc.port);
};
exports.fetch = function(dbot) {
return new rc(dbot);
};