mirror of
https://github.com/reality/dbot.git
synced 2024-12-24 19:52:36 +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) {
|
||||
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}));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
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