Skip to content

Commit

Permalink
change it to be like this
Browse files Browse the repository at this point in the history
  • Loading branch information
idinium96 committed Aug 1, 2020
1 parent 24cf715 commit 23c5d3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
9 changes: 1 addition & 8 deletions src/classes/DiscordWebhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ export = class DiscordWebhook {

sendOfferReview(
offer: TradeOffer,
reason: string,
reasons: string,
pureStock: string[],
time: string,
Expand Down Expand Up @@ -260,13 +259,7 @@ export = class DiscordWebhook {
},
title: '',
description:
`⚠️ An offer sent by ${partnerNameNoFormat} is waiting for review.\nReason: ${
reason === '⬜BACKPACKTF_DOWN'
? '⬜BACKPACKTF_DOWN - failed to check banned status'
: reason === '⬜STEAM_DOWN'
? '⬜STEAM_DOWN - failed to check escrow status'
: reasons
}\n\n__Offer Summary__:\n` +
`⚠️ An offer sent by ${partnerNameNoFormat} is waiting for review.\nReason: ${reasons}\n\n__Offer Summary__:\n` +
tradeSummary.replace('Asked:', '**Asked:**').replace('Offered:', '**Offered:**') +
(value.diff > 0
? `\n📈 ***Profit from overpay:*** ${value.diffRef} ref` +
Expand Down
15 changes: 4 additions & 11 deletions src/classes/MyHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1497,12 +1497,12 @@ export = class MyHandler extends Handler {
(itemsList.their.includes('5021;6') ? `${value.diffKey}]` : `${value.diffRef} ref]`);
}
// Notify partner and admin that the offer is waiting for manual review
if (reason === '⬜BACKPACKTF_DOWN' || reason === '⬜STEAM_DOWN') {
if (reasons.includes('⬜BACKPACKTF_DOWN') || reasons.includes('⬜STEAM_DOWN')) {
this.bot.sendMessage(
offer.partner,
(reason === '⬜BACKPACKTF_DOWN' ? 'Backpack.tf' : 'Steam') +
(reasons.includes('⬜BACKPACKTF_DOWN') ? 'Backpack.tf' : 'Steam') +
' is down and I failed to check your ' +
(reason === '⬜BACKPACKTF_DOWN' ? 'backpack.tf' : 'Escrow') +
(reasons.includes('⬜BACKPACKTF_DOWN') ? 'backpack.tf' : 'Escrow') +
' status, please wait for my owner to manually accept/decline your offer.'
);
} else {
Expand Down Expand Up @@ -1541,7 +1541,6 @@ export = class MyHandler extends Handler {
) {
this.discord.sendOfferReview(
offer,
reason,
reasons.join(', '),
pureStock,
timeWithEmojis.time,
Expand All @@ -1559,13 +1558,7 @@ export = class MyHandler extends Handler {
const offerMessage = offer.message;
this.bot.messageAdmins(
`⚠️ Offer #${offer.id} from ${offer.partner} is waiting for review.` +
`\nReason: ${
reason === '⬜BACKPACKTF_DOWN'
? '⬜BACKPACKTF_DOWN - failed to check banned status'
: reason === '⬜STEAM_DOWN'
? '⬜STEAM_DOWN - failed to check escrow status'
: meta.uniqueReasons.join(', ')
}` +
`\nReason: ${meta.uniqueReasons.join(', ')}` +
`\n\nOffer Summary:\n${offer.summarize(this.bot.schema)}${
value.diff > 0
? `\n📈 Profit from overpay: ${value.diffRef} ref` +
Expand Down

0 comments on commit 23c5d3d

Please sign in to comment.