3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-25 04:02:39 +01:00

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

View File

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