Skip to content

Commit

Permalink
add fields
Browse files Browse the repository at this point in the history
  • Loading branch information
idinium96 committed Aug 4, 2020
1 parent c2a2bf9 commit 968f281
Showing 1 changed file with 50 additions and 29 deletions.
79 changes: 50 additions & 29 deletions src/classes/DiscordWebhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,17 @@ export = class DiscordWebhook {
}` +
(isShowQuickLinks
? `\n\n🔍 ${partnerNameNoFormat}'s info:\n[Steam Profile](${links.steamProfile}) | [backpack.tf](${links.backpackTF}) | [steamREP](${links.steamREP})\n`
: '\n') +
(isShowKeyRate
? `\n🔑 Key rate: ${keyPrice.buy.metal.toString()}/${keyPrice.sell.metal.toString()} ref`
: '') +
(isShowPureStock ? `\n💰 Pure stock: ${pureStock.join(', ').toString()}` : ''),
: '\n'),
fields: [
{
name: 'Status',
value:
(isShowKeyRate
? `\n🔑 Key rate: ${keyPrice.buy.metal.toString()}/${keyPrice.sell.metal.toString()} ref`
: '') +
(isShowPureStock ? `\n💰 Pure stock: ${pureStock.join(', ').toString()}` : '')
}
],
color: botEmbedColor
}
]
Expand Down Expand Up @@ -460,7 +466,7 @@ export = class DiscordWebhook {
},
title: '',
description:
`A trade with ${partnerNameNoFormat} has been marked as accepted.\n__Summary__:\n` +
`__Summary__:\n` +
tradeSummary.replace('Asked:', '**Asked:**').replace('Offered:', '**Offered:**') +
(value.diff > 0
? `\n📈 ***Profit from overpay:*** ${value.diffRef} ref` +
Expand All @@ -471,29 +477,44 @@ export = class DiscordWebhook {
: '') +
(isShowQuickLinks
? `\n\n🔍 ${partnerNameNoFormat}'s info:\n[Steam Profile](${links.steamProfile}) | [backpack.tf](${links.backpackTF}) | [steamREP](${links.steamREP})\n`
: '\n') +
(isMentionInvalidItems ? '\n\n🟨INVALID_ITEMS:\n' + invalidItemsCombine.join(',\n') : '') +
(isShowKeyRate
? `\n🔑 Key rate: ${keyPrice.buy.metal.toString()}/${keyPrice.sell.metal.toString()} ref` +
`${
isAutoKeysEnabled
? ' | Autokeys: ' +
(autoKeysStatus
? '✅' +
(isBankingKeys
? ' (banking)'
: isBuyingKeys
? ' (buying)'
: ' (selling)')
: '🛑')
: ''
}`
: '') +
(isShowPureStock ? `\n💰 Pure stock: ${pureStock.join(', ').toString()}` : '') +
(isShowInventory
? `\n🎒 Total items: ${currentItems + (backpackSlots !== 0 ? '/' + backpackSlots : '')}`
: '') +
(AdditionalNotes ? '\n' + AdditionalNotes : ''),
: '\n'),
fields: [
{
name: 'Status',
value:
(isShowQuickLinks
? `\n\n🔍 ${partnerNameNoFormat}'s info:\n[Steam Profile](${links.steamProfile}) | [backpack.tf](${links.backpackTF}) | [steamREP](${links.steamREP})\n`
: '\n') +
(isMentionInvalidItems
? '\n\n🟨INVALID_ITEMS:\n' + invalidItemsCombine.join(',\n')
: '') +
(isShowKeyRate
? `\n🔑 Key rate: ${keyPrice.buy.metal.toString()}/${keyPrice.sell.metal.toString()} ref` +
`${
isAutoKeysEnabled
? ' | Autokeys: ' +
(autoKeysStatus
? '✅' +
(isBankingKeys
? ' (banking)'
: isBuyingKeys
? ' (buying)'
: ' (selling)')
: '🛑')
: ''
}`
: '') +
(isShowPureStock ? `\n💰 Pure stock: ${pureStock.join(', ').toString()}` : '') +
(isShowInventory
? `\n🎒 Total items: ${currentItems +
(backpackSlots !== 0 ? '/' + backpackSlots : '')}`
: '')
},
{
name: 'Notes:',
value: AdditionalNotes ? '\n' + AdditionalNotes : '-'
}
],
color: botEmbedColor
}
]
Expand Down

0 comments on commit 968f281

Please sign in to comment.