Skip to content

Commit

Permalink
feat: allow accepting messages from any peers
Browse files Browse the repository at this point in the history
  • Loading branch information
Morb0 committed May 6, 2022
1 parent f9b8b73 commit 6a19f6d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/telegram.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ export class TelegramService implements OnApplicationBootstrap {
return;
}

const isAllowedPeer = this.configService
.get('ALLOWED_PEER_IDS', '')
.split(',')
.includes(event.chatId.toString());
const allowedPeerIds = this.configService
.get('ALLOWED_PEER_IDS', '*')
.split(',');
const isAllowedPeer =
allowedPeerIds.includes(event.chatId.toString()) ||
allowedPeerIds.includes('*');
if (!isAllowedPeer) {
return;
}
Expand Down

0 comments on commit 6a19f6d

Please sign in to comment.