mirror of
https://github.com/reality/dbot.git
synced 2024-12-29 14:12:40 +01:00
33 lines
917 B
JavaScript
33 lines
917 B
JavaScript
var request = require('request');
|
|
|
|
var dent = function(dbot) {
|
|
var commands = {
|
|
'~dent': function(event) {
|
|
var username = dbot.config.dent.username;
|
|
var password = dbot.config.dent.password;
|
|
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).');
|
|
console.log(body);
|
|
});
|
|
}
|
|
};
|
|
commands['~dent'].regex = [/^~dent (.+)$/, 2];
|
|
|
|
return {
|
|
'commands': commands
|
|
};
|
|
};
|
|
|
|
exports.fetch = function(dbot) {
|
|
return dent(dbot);
|
|
};
|