Fixed the shop search feature

This commit is contained in:
ION606
2022-05-29 21:30:37 +03:00
parent 69a5a2e18d
commit 65f4de28ed
3 changed files with 7 additions and 9 deletions
+2 -3
View File
@@ -262,9 +262,8 @@ function getShop(message, args, items, bot) {
noinp = true;
}
const items2 = items.slice((ind - 1)*10, (ind - 1)*10+10);
newText = Formatters.codeBlock(items2.map(i => `${i.icon} (${i.name}): \$${i.cost}`)
.filter(f => f.sect = args[0]).join('\n'));
const items2 = items.filter(function(f) { return (f.sect.toLowerCase() == args[0].toLowerCase()) }).slice((ind - 1)*10, (ind - 1)*10+10);
newText = Formatters.codeBlock(items2.map(i => `${i.icon} (${i.name}): \$${i.cost}`).join('\n'));
if (noinp) {
newText += `(Use ${bot.prefix}shop [type] [page number] to access other pages)`;