From d0ac927b92d50316a4cb92e9f21ead2f94deddd4 Mon Sep 17 00:00:00 2001 From: reality Date: Sun, 20 Oct 2013 14:25:43 +0000 Subject: [PATCH] useful error message when attempting to log in with server what dont exist innit --- modules/web/web.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/web/web.js b/modules/web/web.js index 4e14973..f6f5341 100644 --- a/modules/web/web.js +++ b/modules/web/web.js @@ -42,6 +42,9 @@ var webInterface = function(dbot) { if(!server || !username) return callback(null, false, { 'message': 'Please provide a username in the format of name@server (Servers: ' + _.keys(dbot.config.servers).join(', ') + ')' }); + if(!_.has(dbot.config.servers, server)) return callback(null, false, { 'message': + 'Please provide a valid server (Servers: ' + + _.keys(dbot.config.servers).join(', ') + ')' }); dbot.api.users.resolveUser(server, username, function(user) { if(user) {