useful error message when attempting to log in with server what dont exist innit

This commit is contained in:
reality 2013-10-20 14:25:43 +00:00
parent 54a0a96cbc
commit d0ac927b92

View File

@ -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) {