mirror of
https://github.com/reality/dbot.git
synced 2024-12-24 11:42:36 +01:00
dent module [#113]
This commit is contained in:
parent
012d6fa1a8
commit
bb977e94e2
4
modules/dent/config.json
Normal file
4
modules/dent/config.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"username": "youruserhere",
|
||||
"password": "yourpasswordhere"
|
||||
}
|
31
modules/dent/dent.js
Normal file
31
modules/dent/dent.js
Normal file
@ -0,0 +1,31 @@
|
||||
var request = require('request');
|
||||
|
||||
var dent = function(dbot) {
|
||||
var username = dbot.config.dent.username;
|
||||
var password = dbot.config.dent.password;
|
||||
var commands = {
|
||||
'~dent': function(event) {
|
||||
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).');
|
||||
});
|
||||
}
|
||||
};
|
||||
commands['~dent'].regex = [/^~dent (.+)$/, 2];
|
||||
|
||||
return {
|
||||
'commands': commands
|
||||
};
|
||||
};
|
||||
|
||||
exports.fetch = function(dbot) {
|
||||
return dent(dbot);
|
||||
};
|
Loading…
Reference in New Issue
Block a user