add string functionality

This commit is contained in:
Douglas Gardner 2013-03-06 13:10:54 +00:00
parent ab8e297769
commit 3cdf3fd417
2 changed files with 8 additions and 2 deletions

View File

@ -11,11 +11,12 @@ var finger = function(dbot) {
'~finger': function(event) {
var username = event.params[1];
exec("finger -s " + username + "@central.aber.ac.uk",function(error,stdout,stderr){
stdout = stdout.replace(/(\r\n|\n|\r)/gm,"");
name = stdout.search("Name:");
stdout = stdout.substring(name);
ret = stdout.search("Dir");
stdout = stdout.substring(0,ret);
event.reply(stdout);
stdout = stdout.substring(6,ret);
event.reply(dbot.t("name",{user: username, name: stdout}));
});
}
};

View File

@ -0,0 +1,5 @@
{
"name": {
"en": "{user} is {name}."
}
}