Skip to content

Commit

Permalink
mention in_value didn't work well, use previous
Browse files Browse the repository at this point in the history
  • Loading branch information
idinium96 committed Jul 26, 2020
1 parent 7576f03 commit 1b00548
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 9 additions & 1 deletion src/classes/DiscordWebhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,15 @@ export = class DiscordWebhook {
});
});

const isMentionInvalidItems = (this.bot.handler as MyHandler).getAcceptedWithInvalidItemsOrOverstockedStatus();
const theirItemsFiltered = theirItems.filter(sku => !['5021;6', '5000;6', '5001;6', '5002;6'].includes(sku));

if (process.env.DISABLE_CRAFTWEAPON_AS_CURRENCY === 'false') {
theirItemsFiltered.filter(sku => !(this.bot.handler as MyHandler).craftweapon().includes(sku));
}

const isMentionInvalidItems = theirItemsFiltered.some((sku: string) => {
return this.bot.pricelist.getPrice(sku, false) === null;
});

const mentionOwner =
this.enableMentionOwner === true && (isMentionOurItems || isMentionThierItems)
Expand Down
8 changes: 0 additions & 8 deletions src/classes/MyHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ export = class MyHandler extends Handler {

private customGameName: string;

private isAcceptedWithInvalidItemsOrOverstocked = false;

private isUsingAutoPrice = true;

private scrapAdjustmentValue = 0;
Expand Down Expand Up @@ -235,10 +233,6 @@ export = class MyHandler extends Handler {
return this.minimumKeysDupeCheck;
}

getAcceptedWithInvalidItemsOrOverstockedStatus(): boolean {
return this.isAcceptedWithInvalidItemsOrOverstocked;
}

getAutokeysEnabled(): boolean {
return this.autokeysEnabled;
}
Expand Down Expand Up @@ -1037,7 +1031,6 @@ export = class MyHandler extends Handler {
// const counteroffer = offer.counter();
// }

this.isAcceptedWithInvalidItemsOrOverstocked = false;
if (
((uniqueReasons.includes('🟨INVALID_ITEMS') &&
process.env.DISABLE_ACCEPT_INVALID_ITEMS_OVERPAY !== 'true') ||
Expand All @@ -1051,7 +1044,6 @@ export = class MyHandler extends Handler {
exchange.our.value < exchange.their.value &&
exchange.our.value !== 0
) {
this.isAcceptedWithInvalidItemsOrOverstocked = true;
offer.log(
'trade',
`contains invalid items/overstocked, but offer more or equal value, accepting. Summary:\n${offer.summarize(
Expand Down

0 comments on commit 1b00548

Please sign in to comment.