/itemsearch: Fix using the 'all' parameter (#4091)

Previously, the command allowed users to broadcast with ', all'
I removed the ',all' option because the command doesn't support separating words with just a comma anyway.
This commit is contained in:
MacChaeger 2017-10-29 13:21:41 -05:00 committed by Guangcong Luo
parent 9fd88de6c1
commit 86bbf874b0

View File

@ -1247,7 +1247,8 @@ function runItemsearch(target, cmd, canAll, message) {
let showAll = false;
target = target.trim();
if (target.substr(target.length - 5) === ', all' || target.substr(target.length - 4) === ',all') {
if (target.substr(target.length - 5) === ', all') {
if (!canAll) return {reply: "A search ending in ', all' cannot be broadcast."};
showAll = true;
target = target.substr(0, target.length - 5);
}