mirror of
https://github.com/baptisteArno/typebot.io.git
synced 2026-06-05 21:04:43 +08:00
🔧 (scripts) Send daily report notification on Discord
This commit is contained in:
parent
a33d8cd1b4
commit
d17b232a86
@ -1,4 +1,3 @@
|
||||
import { sendMessage } from "@typebot.io/telemetry/sendMessage";
|
||||
import { formatChurnAgentDiscordMessages } from "../churnAgent/formatChurnAgentDiscordMessages";
|
||||
import { getYesterdayChurnSummary } from "../churnAgent/getYesterdayChurnSummary";
|
||||
import { cleanExpiredData } from "../helpers/cleanExpiredData";
|
||||
@ -18,7 +17,8 @@ export const main = async () => {
|
||||
// const { totalDeletedWorkspaces } = await deleteOrWarnInactiveWorkspaces();
|
||||
// reportMessage += `🔥 ${totalDeletedWorkspaces} workspaces were deleted.\n`;
|
||||
|
||||
await sendMessage(`Daily report:
|
||||
await sendDiscordMessage(
|
||||
`Daily report:
|
||||
|
||||
📥 ${totalResults} collected results
|
||||
🏭 ${totalWorkspaces} active workspaces
|
||||
@ -27,7 +27,11 @@ export const main = async () => {
|
||||
${formatSubscriptionMessage(subscriptionTransitions)}
|
||||
|
||||
[Go to daily dashboard](https://eu.posthog.com/project/${process.env.POSTHOG_PROJECT_ID}/dashboard/${process.env.POSTHOG_DAILY_DASHBOARD_ID})
|
||||
[Go to web analytics](https://eu.posthog.com/project/${process.env.POSTHOG_PROJECT_ID}/web)`);
|
||||
[Go to web analytics](https://eu.posthog.com/project/${process.env.POSTHOG_PROJECT_ID}/web)`,
|
||||
{
|
||||
channelId: process.env.DISCORD_CHANNEL_ID!,
|
||||
},
|
||||
);
|
||||
|
||||
if (!process.env.DISCORD_CHANNEL_ID) {
|
||||
console.log("DISCORD_CHANNEL_ID is not set, skipping churn agent");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user