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!

Fixed integration with Telegram (#184)

Yevhenii Kulisidibdeeda1ed2c2
diff --git a/.env.example b/.env.example
index ba0bb89f4..d2408cb19 100644
--- a/.env.example
+++ b/.env.example
@@ -58,8 +58,8 @@ GITHUB_OAUTH2_CLIENT_ID=
GITHUB_OAUTH2_CLIENT_SECRET=
# Integrations
-ENABLE_INTEGRATIONS=true
-ENABLE_TELEGRAM_INTEGRATION=true
+ENABLE_INTEGRATIONS=false
+ENABLE_TELEGRAM_INTEGRATION=false
# Telegram integration
TELEGRAM_BOT_TOKEN=''
diff --git a/CONTRIBUTING.MD b/CONTRIBUTING.MD
index 2bb0400d1..366b7b674 100644
--- a/CONTRIBUTING.MD
+++ b/CONTRIBUTING.MD
@@ -15,7 +15,7 @@ git clone [email protected]:[YOUR_USERNAME]/swetrix-api.git
### 2. Install dependencies
To install the dependencies you need to run the following command in the root of the repository:
```bash
-npm install
+npm install --legacy-peer-deps
```
### 3. Set up environment variables
diff --git a/apps/production/src/integrations/telegram/telegram.service.ts b/apps/production/src/integrations/telegram/telegram.service.ts
index c1aacb896..b53af6db2 100644
--- a/apps/production/src/integrations/telegram/telegram.service.ts
+++ b/apps/production/src/integrations/telegram/telegram.service.ts
@@ -1,4 +1,4 @@
-import { Injectable } from '@nestjs/common'
+import { Injectable, Optional } from '@nestjs/common'
import { ConfigService } from '@nestjs/config'
import { InjectBot } from 'nestjs-telegraf'
import { Markup, Telegraf } from 'telegraf'
@@ -11,7 +11,7 @@ import { Message } from './entities/message.entity'
@Injectable()
export class TelegramService {
constructor(
- @InjectBot() private readonly bot: Telegraf<Context>,
+ @Optional() @InjectBot() private readonly bot: Telegraf<Context>,
private readonly userService: UserService,
private readonly configService: ConfigService,
@InjectRepository(Message)