From 9d277c7ac632b961ed2a0a1da4aa9c0050f6a8ef Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 6 Mar 2013 13:20:58 +0000 Subject: [PATCH] add hackish handling of non-existent users --- modules/finger/finger.js | 6 +++++- modules/finger/strings.json | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/finger/finger.js b/modules/finger/finger.js index 1334af6..f0a2e34 100644 --- a/modules/finger/finger.js +++ b/modules/finger/finger.js @@ -16,7 +16,11 @@ var finger = function(dbot) { stdout = stdout.substring(name); ret = stdout.search("Dir"); stdout = stdout.substring(6,ret); - event.reply(dbot.t("name",{user: username, name: stdout})); + if (stdout == "Welcom") { + event.reply(dbot.t("nonexistent",{user: username})); + } else { + event.reply(dbot.t("name",{user: username, name: stdout})); + } }); } }; diff --git a/modules/finger/strings.json b/modules/finger/strings.json index 5b79835..710e0f5 100644 --- a/modules/finger/strings.json +++ b/modules/finger/strings.json @@ -1,5 +1,8 @@ { "name": { "en": "{user} is {name}." + }, + "nonexistent": { + "en": "{user} not found." } }