Skip to content

Commit

Permalink
🔀Merge pull request #409 from TF2Autobot/add-name-to-partial-price-up…
Browse files Browse the repository at this point in the history
…date-alert

💅 include name in partial price update summary
  • Loading branch information
idinium96 authored Mar 4, 2021
2 parents e97de9d + ccad5ee commit b55fa06
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/classes/Pricelist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -912,18 +912,21 @@ export default class Pricelist extends EventEmitter {
if (isUpdate) {
match.group = 'isPartialPriced';
pricesChanged = true;
const dw = opt.discordWebhook.sendAlert;
const isDwEnabled = dw.enable && dw.url !== '';

const msg =
`${match.sku}:\nâ–¸ ` +
`${
isDwEnabled ? `[${match.name}](https://www.prices.tf/items/${match.sku})` : match.name
} (${match.sku}):\nâ–¸ ` +
[
`old: ${oldPrice.buy.toString()}/${oldPrice.sell.toString()}`,
`current: ${match.buy.toString()}/${match.sell.toString()}`,
`pricestf: ${newBuy.toString()}/${newSell.toString()}`
].join('\nâ–¸ ');

if (opt.sendAlert.partialPrice.onUpdate) {
const dw = opt.discordWebhook.sendAlert;
if (dw.enable && dw.url !== '') {
if (isDwEnabled) {
sendAlert('isPartialPriced', this.bot, msg);
} else {
this.bot.messageAdmins('Partial price update\n\n' + msg, []);
Expand Down

0 comments on commit b55fa06

Please sign in to comment.