We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba2f974 commit 40b37e6Copy full SHA for 40b37e6
common/notifications.ts
@@ -1,8 +1,16 @@
1
import { Client, EmbedBuilder } from 'discord.js'
2
-import { priceFormat } from './utils.js'
+import fs from 'fs'
3
+import { parseParams, priceFormat } from './utils.js'
4
5
export async function sendNotifications(bot: Client, notifications: NotificationData[]) {
6
+ const config: Config = JSON.parse(fs.readFileSync('./config.json').toString())
7
+
8
for (const notif of notifications) {
9
+ // If we have url_params, add them to the URL
10
+ if (Object.keys(config.url_params).length > 0) {
11
+ notif.link += parseParams(config.url_params)
12
+ }
13
14
if (notif.oldPrice === 0 && notif.newPrice !== 0) {
15
// Old price was 0 but new price isn't? Item is now in stock!
16
await sendInStock(bot, notif)
0 commit comments