Skip to content

Commit

Permalink
response/filters: (list.#) return message even if list is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Apr 27, 2017
1 parent d5e0b25 commit ce79e69
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/parser.js
Expand Up @@ -279,16 +279,16 @@ Parser.prototype.parseMessage = async function (message, attr) {
switch (system) {
case 'alias':
list = _.map(_.filter(global.systems[system].alias, function (o) { return o.visible }), function (n) { return n.alias }).join(', ')
return list
return list.length > 0 ? list : ' '
case '!alias':
list = _.map(_.filter(global.systems[system].alias, function (o) { return o.visible }), function (n) { return '!' + n.alias }).join(', ')
return list
return list.length > 0 ? list : ' '
case 'command':
list = _.map(_.filter(global.systems['customcommands'].commands, function (o) { return o.visible }), function (n) { return n.command }).join(', ')
return list
return list.length > 0 ? list : ' '
case '!command':
list = _.map(_.filter(global.systems['customcommands'].commands, function (o) { return o.visible }), function (n) { return '!' + n.command }).join(', ')
return list
return list.length > 0 ? list : ' '
default:
return ''
}
Expand Down

0 comments on commit ce79e69

Please sign in to comment.