Skip to content

Commit

Permalink
fix bot crashed here
Browse files Browse the repository at this point in the history
  • Loading branch information
idinium96 committed Aug 1, 2020
1 parent f9ed24b commit 24cf715
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions src/classes/MyHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,14 @@ export = class MyHandler extends Handler {
reason: '🟫DUPED_ITEMS';
assetid: string;
}
| {
reason: '⬜STEAM_DOWN';
error?: string;
}
| {
reason: '⬜BACKPACKTF_DOWN';
error?: string;
}
)[] = [];

let assetidsToCheck = [];
Expand Down Expand Up @@ -954,7 +962,17 @@ export = class MyHandler extends Handler {
}
} catch (err) {
log.warn('Failed to check escrow: ', err);
return { action: 'skip', reason: '⬜STEAM_DOWN' };
const reasons = wrongAboutOffer.map(wrong => wrong.reason);
const uniqueReasons = reasons.filter(reason => reasons.includes(reason));

return {
action: 'skip',
reason: '⬜STEAM_DOWN',
meta: {
uniqueReasons: uniqueReasons,
reasons: wrongAboutOffer
}
};
}

offer.log('info', 'checking bans...');
Expand All @@ -968,7 +986,17 @@ export = class MyHandler extends Handler {
}
} catch (err) {
log.warn('Failed to check banned: ', err);
return { action: 'skip', reason: '⬜BACKPACKTF_DOWN' };
const reasons = wrongAboutOffer.map(wrong => wrong.reason);
const uniqueReasons = reasons.filter(reason => reasons.includes(reason));

return {
action: 'skip',
reason: '⬜BACKPACKTF_DOWN',
meta: {
uniqueReasons: uniqueReasons,
reasons: wrongAboutOffer
}
};
}

if (this.dupeCheckEnabled && assetidsToCheck.length > 0) {
Expand Down

0 comments on commit 24cf715

Please sign in to comment.