Skip to content

feat: Add Telegram bot ingestion and user linking flow - #4

Open
klinki wants to merge 2 commits into
feat/telegramfrom
codex/implement-telegram-bot-connection
Open

klinki wants to merge 2 commits into
feat/telegramfrom
codex/implement-telegram-bot-connection

Conversation

@klinki

@klinki klinki commented Apr 21, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Add official Telegram ingestion (long-polling bot) to allow users to forward private-chat text/links into the existing capture pipeline.
  • Provide a simple, secure linking flow so a shared bot can deliver messages to the correct Sentinel user.
  • Reuse the existing capture normalization and processing pipeline rather than inventing a new ingestion path.

Description

  • Add domain entities TelegramChatLink, TelegramLinkCode, and TelegramIngestionState and register them in ApplicationDbContext to persist link bindings, link codes, and poll cursors.
  • Implement ITelegramIntegrationService and TelegramIntegrationService to issue/consume short-lived link codes, filter private text updates, normalize messages into CaptureRequestDto (ContentType = Note, metadata/tags/labels) and enqueue processing.
  • Add authenticated API endpoints under api/v1/integrations/telegram for GET /status, POST /link-code, and DELETE /link to manage linking and show pending codes.
  • Wire configuration and DI: add TelegramIntegrationOptions to appsettings, register options, register the service in application DI, and add a worker hosted service TelegramPollingHostedService to run long-poll cycles in the worker.
  • Frontend: add TelegramLinkStatus and TelegramLinkCodeResponse types and methods to AuthService, extend the Settings UI with a Telegram section to request link codes, display status/countdown, and unlink, and update the settings component test stubs to include the new calls.

Testing

  • Ran the settings component unit spec with Vitest: npm run test -- --watch=false --include src/app/features/settings/settings.component.spec.ts and the spec passed ✅.
  • Attempted full frontend build npm run build, but it failed in this environment due to external Google Fonts inlining returning HTTP 403 (environmental/network constraint) ⚠️.
  • Attempted dotnet build but the dotnet CLI is not available in this environment, so backend compilation could not be executed here ⚠️.

Codex Task

Co-authored-by: GPT-5.3-Codex <gpt-5.3-codex@openai.com>
Co-authored-by: GPT-5.3-Codex <gpt-5.3-codex@openai.com>
@klinki
klinki marked this pull request as ready for review August 10, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant