diff --git a/modules/finger/finger.js b/modules/finger/finger.js index 84256e6..1334af6 100644 --- a/modules/finger/finger.js +++ b/modules/finger/finger.js @@ -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})); }); } }; diff --git a/modules/finger/strings.json b/modules/finger/strings.json new file mode 100644 index 0000000..5b79835 --- /dev/null +++ b/modules/finger/strings.json @@ -0,0 +1,5 @@ +{ + "name": { + "en": "{user} is {name}." + } +}