mirror of
https://github.com/reality/dbot.git
synced 2024-12-25 20:22:39 +01:00
add string functionality
This commit is contained in:
parent
ab8e297769
commit
3cdf3fd417
@ -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}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
5
modules/finger/strings.json
Normal file
5
modules/finger/strings.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"name": {
|
||||||
|
"en": "{user} is {name}."
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user