3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 19:52:36 +01:00

dont show including if no aliases

This commit is contained in:
reality 2013-01-20 18:26:07 +00:00
parent bf40369352
commit eb104f157b

View File

@ -10,17 +10,24 @@ var commands = function(dbot) {
var aliases = this.api.getAliases(event.server, alias);
var aliasCount = aliases.length;
var aliases = _.first(aliases, 10);
var including = 'including: ';
for(var i=0;i<aliases.length;i++) {
including += aliases[i] + ', ';
}
including = including.slice(0, -2) + '.';
if(aliasCount != 0) {
var aliases = _.first(aliases, 10);
var including = 'including: ';
for(var i=0;i<aliases.length;i++) {
including += aliases[i] + ', ';
}
including = including.slice(0, -2) + '.';
event.reply(dbot.t('primary', {
'user': alias,
'count': aliasCount
}) + including);
event.reply(dbot.t('primary', {
'user': alias,
'count': aliasCount
}) + including);
} else {
event.reply(dbot.t('primary', {
'user': alias,
'count': aliasCount
}));
}
} else if(_.has(knownUsers.aliases, alias)) {
event.reply(dbot.t('alias', {
'alias': alias,