From dc2f898df632633d9ace0ecfb7609a4395be2694 Mon Sep 17 00:00:00 2001 From: nwjgit Date: Tue, 3 Oct 2023 23:19:27 -0500 Subject: [PATCH 1/3] Return sacrifice icon to item search --- src/lib/events.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/events.ts b/src/lib/events.ts index ce6ea76352..b2bbe5a87d 100644 --- a/src/lib/events.ts +++ b/src/lib/events.ts @@ -189,6 +189,7 @@ const mentionCommands: MentionCommand[] = [ if (items.length === 0) return msg.reply('No results for that item.'); const gettedItem = items[0]; + const { sacrificed_bank: sacrificedBank } = await user.fetchStats({ sacrificed_bank: true }); let str = `Found ${items.length} items:\n${items .slice(0, 5) @@ -197,6 +198,7 @@ const mentionCommands: MentionCommand[] = [ if (user.cl.has(item.id)) icons.push(Emoji.CollectionLog); if (user.bank.has(item.id)) icons.push(Emoji.Bank); + if ((sacrificedBank as ItemBank)[item.id]) icons.push(Emoji.Incinerator); const price = toKMB(Math.floor(item.price)); From 2be13209372cbac8291ba4615b9059404e41c988 Mon Sep 17 00:00:00 2001 From: nwjgit Date: Tue, 3 Oct 2023 23:54:54 -0500 Subject: [PATCH 2/3] warning message fix --- src/lib/events.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/events.ts b/src/lib/events.ts index b2bbe5a87d..32935fa63c 100644 --- a/src/lib/events.ts +++ b/src/lib/events.ts @@ -198,7 +198,12 @@ const mentionCommands: MentionCommand[] = [ if (user.cl.has(item.id)) icons.push(Emoji.CollectionLog); if (user.bank.has(item.id)) icons.push(Emoji.Bank); - if ((sacrificedBank as ItemBank)[item.id]) icons.push(Emoji.Incinerator); + if ( + (sacrificedBank as ItemBank)[item.id] !== undefined && + (sacrificedBank as ItemBank)[item.id] !== null + ) { + icons.push(Emoji.Incinerator); + } const price = toKMB(Math.floor(item.price)); From cc0367ca54e8501926d5c9a55e9a47b71c61ea42 Mon Sep 17 00:00:00 2001 From: themrrobert <10122432+themrrobert@users.noreply.github.com> Date: Wed, 11 Oct 2023 05:36:38 -0700 Subject: [PATCH 3/3] Simplify line --- src/lib/events.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/lib/events.ts b/src/lib/events.ts index 32935fa63c..7873d8fc96 100644 --- a/src/lib/events.ts +++ b/src/lib/events.ts @@ -198,12 +198,7 @@ const mentionCommands: MentionCommand[] = [ if (user.cl.has(item.id)) icons.push(Emoji.CollectionLog); if (user.bank.has(item.id)) icons.push(Emoji.Bank); - if ( - (sacrificedBank as ItemBank)[item.id] !== undefined && - (sacrificedBank as ItemBank)[item.id] !== null - ) { - icons.push(Emoji.Incinerator); - } + if (((sacrificedBank as ItemBank)[item.id] ?? 0) > 0) icons.push(Emoji.Incinerator); const price = toKMB(Math.floor(item.price));