Documentation
¶
Overview ¶
Package telegram_webhook implements the inbound half of Artel's BYO-bot Telegram integration: receiving updates from Telegram for a bot the user linked via externalconnections.Service.AddTelegramConnection, and relaying them into that user's workbench chat session (a headless Claude Code session running in a Docker container, exposed as a WebSocket speaking internal/chatprotocol's normalized JSON event protocol).
Structured to mirror internal/transport/gitlab_webhook.Handler closely: a plain http.Handler (not gRPC-gateway), narrow injected deps, ServeHTTP does method check -> path-based connection id extraction -> external_connections lookup -> constant-time secret comparison -> bounded body read -> dispatch, always responding 200 OK so nothing about internal state ever leaks to the (unauthenticated-until-the-secret-check) caller.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves POST /webhooks/telegram/{external_connection_id} — the inbound endpoint Telegram calls for a user's linked bot. One external_connections row per bot; ChatID is captured from the first inbound message and persisted back onto that row.
func New ¶
func New( baseCtx context.Context, externalConns repository.ExternalConnectionRepo, workbenches recentWorkbenchLookup, workbenchSvc bridgeTargetResolver, mom toolExecutor, ) *Handler