feat: add discord-webhooks module for embed notifications

- New module with batching queue, per-webhook event filtering
- Hytale orange (#F26430) embeds with timestamps
- Retry on 429 rate limits
- Integrated into all 5 tracker modules
This commit is contained in:
devilreef 2026-01-24 00:17:27 +06:00
parent be1102119a
commit 48b3359792
13 changed files with 357 additions and 5 deletions

View file

@ -1,5 +1,6 @@
import type { Module, ModuleDependencies } from '../../core/module.js'
import type { HytaleTrackerConfig } from '../../types.js'
import { formatPresskitEmbed } from '../discord-webhooks/formatter.js'
import { formatPresskitUpdate } from './formatter.js'
import { checkPresskitUpdate } from './tracker.js'
@ -64,6 +65,9 @@ export function hytalePresskitFactory(
chatIds: this.config.chatIds,
disableLinkPreview: true,
})
if (this.dependencies.webhooks) {
await this.dependencies.webhooks.send('presskit', formatPresskitEmbed(update))
}
this.dependencies.logger(this.name, `Update detected: ${update.size} bytes`)
}
}