fix(telegram): pass senderID with username to HandleMessage

Fixes a regression introduced in commit 9d5728e where HandleMessage
was called with only the numeric user ID instead of the full senderID
that includes the username (format: "userID|username").

This caused the allowlist check in base.go to fail when using username-based
filtering in the allow_from configuration, resulting in all messages being
silently rejected even from authorized users.

The fix ensures the correctly formatted senderID variable is passed to
HandleMessage, restoring support for username-based allowlist filtering.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
omrikiei 2026-02-26 20:00:11 -06:00
parent 3584c0c7be
commit eaf4680f30

View file

@ -384,7 +384,7 @@ func (c *TelegramChannel) handleMessage(ctx context.Context, message *telego.Mes
"peer_id": peerID, "peer_id": peerID,
} }
c.HandleMessage(fmt.Sprintf("%d", user.ID), fmt.Sprintf("%d", chatID), content, mediaPaths, metadata) c.HandleMessage(senderID, fmt.Sprintf("%d", chatID), content, mediaPaths, metadata)
return nil return nil
} }