mirror of
https://github.com/reality/dbot.git
synced 2024-12-28 05:32:50 +01:00
add shizzle
This commit is contained in:
parent
1082ea65d4
commit
184d70d3a7
12
modules/rc/README.md
Normal file
12
modules/rc/README.md
Normal 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.
|
@ -1,3 +1,6 @@
|
||||
{
|
||||
"port":1337
|
||||
"port":14628,
|
||||
"address": "127.0.0.1",
|
||||
"server": "freenode",
|
||||
"channel": "#zuzak2"
|
||||
}
|
||||
|
@ -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);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user