Download ping

This commit is contained in:
2026-07-13 00:03:28 +02:00
parent b9fd72d150
commit 824ad69bf2
5 changed files with 93 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ const PLAN_NAMES_BY_PRODUCT = {
const EMBED_COLOR_SALE = 0x2ecc71;
const EMBED_COLOR_NEW_USER = 0x3498db;
const EMBED_COLOR_DOWNLOAD = 0x9b59b6;
const isPurchaseEventType = (eventType) =>
PURCHASE_EVENT_TYPES.has(String(eventType || '').toUpperCase());
@@ -95,8 +96,21 @@ const notifyNewUser = ({ platform, appVersion, provider } = {}) => {
});
};
const notifyDownload = ({ platform, appVersion } = {}) => {
sendDiscordEmbed(DOWNLOADS_WEBHOOK_URL, {
title: '⬇️ Neuer Download',
color: EMBED_COLOR_DOWNLOAD,
fields: [
{ name: 'Gerät', value: formatPlatform(platform), inline: true },
{ name: 'App-Version', value: sanitizeEmbedText(appVersion) || 'Unbekannt', inline: true },
],
timestamp: new Date().toISOString(),
});
};
module.exports = {
isPurchaseEventType,
notifyPurchase,
notifyNewUser,
notifyDownload,
};