telegram_webhook

package
v1.0.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

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

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL