3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-26 20:52:39 +01:00
dbot/modules/dent/dent.js

33 lines
917 B
JavaScript
Raw Normal View History

2013-01-10 18:44:01 +01:00
var request = require('request');
var dent = function(dbot) {
var commands = {
'~dent': function(event) {
2013-01-10 19:00:15 +01:00
var username = dbot.config.dent.username;
var password = dbot.config.dent.password;
2013-01-10 18:44:01 +01:00
var auth = "Basic " +
new Buffer(username + ":" + password).toString("base64");
request.post({
'url': 'http://identi.ca/api/statuses/update.json?status=' +
event.input[1],
'headers': {
'Authorization': auth
}
},
function(error, response, body) {
event.reply('Status posted (probably).');
2013-01-10 19:00:15 +01:00
console.log(body);
2013-01-10 18:44:01 +01:00
});
}
};
commands['~dent'].regex = [/^~dent (.+)$/, 2];
return {
'commands': commands
};
};
exports.fetch = function(dbot) {
return dent(dbot);
};