forked from GitHub/dbot
such crashy
This commit is contained in:
parent
7a4dc61412
commit
912df73b56
@ -70,7 +70,7 @@ var steam = function(dbot) {
|
|||||||
},
|
},
|
||||||
'json': true
|
'json': true
|
||||||
}, function(err, res, body) {
|
}, function(err, res, body) {
|
||||||
if(_.has(body, 'response') && _.has(body.response, 'players')) {
|
if(_.has(body, 'response') && _.has(body.response, 'players') && body.response.player != null) {
|
||||||
callback(null, body.response.players[0]);
|
callback(null, body.response.players[0]);
|
||||||
} else {
|
} else {
|
||||||
callback(true, null);
|
callback(true, null);
|
||||||
@ -98,6 +98,8 @@ var steam = function(dbot) {
|
|||||||
});
|
});
|
||||||
if(_.has(player, 'gameserverip')) {
|
if(_.has(player, 'gameserverip')) {
|
||||||
var host = player.gameserverip.split(':');
|
var host = player.gameserverip.split(':');
|
||||||
|
:qa
|
||||||
|
:qa
|
||||||
output += ' (Server: ' + host[0] + ' Port: ' + host[1] + ')';
|
output += ' (Server: ' + host[0] + ' Port: ' + host[1] + ')';
|
||||||
}
|
}
|
||||||
event.reply(output);
|
event.reply(output);
|
||||||
@ -115,12 +117,12 @@ var steam = function(dbot) {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
event.reply('something went wrong');
|
event.reply('Unknown Steam Username');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
event.reply('something went wrong');
|
event.reply('Unknown Steam Username');
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
Loading…
Reference in New Issue
Block a user