don't show empty stacks in inventory

This commit is contained in:
Jill 2023-11-19 20:01:00 +03:00
parent 249cf02490
commit 0cd2b02282
Signed by: oat
GPG Key ID: 33489AA58A955108
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ export default {
.where('user', member.user.id);
// kind of stupid kind of awful
const items = (await Promise.all(itemsList.map(async i => ({item: await getItem(i.item), quantity: i.quantity})))).filter(i => i.item);
const items = (await Promise.all(itemsList.map(async i => ({item: await getItem(i.item), quantity: i.quantity})))).filter(i => i.item && i.quantity !== 0);
await interaction.followUp(
`Your inventory:\n${items.length === 0 ? '_Your inventory is empty!_' : items.map(i => `- ${formatItems(i.item!, i.quantity)}\n_${i.item!.description}_`).join('\n')}`