Skip to content

Commit

Permalink
ignore events from other chats
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Dec 7, 2023
1 parent 113f2ed commit dcd06c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/events/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ func (l *TelegramListener) procEvents(update tbapi.Update) error {
log.Printf("[DEBUG] %s", string(msgJSON))

fromChat := update.Message.Chat.ID
if fromChat != l.chatID { // ignore messages from other chats
return nil
}

msg := l.transform(update.Message)
log.Printf("[DEBUG] incoming msg: %+v", msg)

Expand Down

0 comments on commit dcd06c1

Please sign in to comment.