Skip to content

Commit 6aee118

Browse files
committed
🔨 fix some inconsistency
1 parent d0be169 commit 6aee118

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Diff for: src/classes/Commands/sub-classes/Manager.ts

+12-5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import log from '../../../lib/logger';
1818
import { pure, testPriceKey } from '../../../lib/tools/export';
1919
import filterAxiosError from '@tf2autobot/filter-axios-error';
2020
import { AxiosError } from 'axios';
21+
import { Entry } from '../../Pricelist';
2122

2223
// Bot manager commands
2324

@@ -619,7 +620,13 @@ export default class ManagerCommands {
619620
}
620621
}
621622

622-
const match = this.bot.pricelist.getPrice({ priceKey: listingSKU });
623+
let match: Entry | null;
624+
const assetIdPrice = this.bot.pricelist.getPrice({ priceKey: listing.id.slice('440_'.length) });
625+
if (null !== assetIdPrice) {
626+
match = assetIdPrice;
627+
} else {
628+
match = this.bot.pricelist.getPrice({ priceKey: listingSKU });
629+
}
623630

624631
if (isFilterCantAfford && listing.intent === 0 && match !== null) {
625632
const canAffordToBuy = inventoryManager.isCanAffordToBuy(match.buy, inventory);
@@ -708,8 +715,8 @@ export default class ManagerCommands {
708715
}
709716
}
710717

711-
const skusToCheck = Object.keys(pricelist);
712-
const pricelistCount = skusToCheck.length;
718+
const priceKeysToCheck = Object.keys(pricelist);
719+
const pricelistCount = priceKeysToCheck.length;
713720

714721
if (pricelistCount > 0) {
715722
clearTimeout(this.executeRefreshListTimeout);
@@ -718,7 +725,7 @@ export default class ManagerCommands {
718725
log.debug(
719726
'Checking listings for ' +
720727
pluralize('item', pricelistCount, true) +
721-
` [${skusToCheck.join(', ')}] ...`
728+
` [${priceKeysToCheck.join(', ')}] ...`
722729
);
723730

724731
this.bot.sendMessage(
@@ -738,7 +745,7 @@ export default class ManagerCommands {
738745
}, (this.pricelistCount > 4000 ? 60 : 30) * 60 * 1000);
739746

740747
await this.bot.listings.recursiveCheckPricelist(
741-
skusToCheck,
748+
priceKeysToCheck,
742749
pricelist,
743750
true,
744751
this.pricelistCount > 4000 ? 400 : 200,

0 commit comments

Comments
 (0)