Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Send Slack & Discord alerts independently from Telegram integration status

Blue Mouse998e585c65c3
diff --git a/apps/production/src/project/project.service.ts b/apps/production/src/project/project.service.ts
index a312bfec9..e753047ed 100644
--- a/apps/production/src/project/project.service.ts
+++ b/apps/production/src/project/project.service.ts
@@ -467,7 +467,7 @@ export class ProjectService {
}
findWhere(
- where: Record<string, unknown>,
+ where: Record<string, unknown> | Record<string, unknown>[],
relations?: string[],
): Promise<Project[]> {
return this.projectsRepository.find({ where, relations })
diff --git a/apps/production/src/task-manager/task-manager.service.ts b/apps/production/src/task-manager/task-manager.service.ts
index 93833ba7b..921acce87 100644
--- a/apps/production/src/task-manager/task-manager.service.ts
+++ b/apps/production/src/task-manager/task-manager.service.ts
@@ -943,13 +943,29 @@ export class TaskManagerService {
@Cron(CronExpression.EVERY_5_MINUTES)
async checkOnlineUsersAlerts(): Promise<void> {
const projects = await this.projectService.findWhere(
- {
- admin: {
- isTelegramChatIdConfirmed: true,
- planCode: Not(PlanCode.none),
- dashboardBlockReason: IsNull(),
+ [
+ {
+ admin: {
+ isTelegramChatIdConfirmed: true,
+ planCode: Not(PlanCode.none),
+ dashboardBlockReason: IsNull(),
+ },
},
- },
+ {
+ admin: {
+ slackWebhookUrl: Not(IsNull()),
+ planCode: Not(PlanCode.none),
+ dashboardBlockReason: IsNull(),
+ },
+ },
+ {
+ admin: {
+ discordWebhookUrl: Not(IsNull()),
+ planCode: Not(PlanCode.none),
+ dashboardBlockReason: IsNull(),
+ },
+ },
+ ],
['admin'],
)