Telegram adapter
Parse Bot API updates, validate the secret token and identify entry type while keeping platform detail separate from customer business logic.
Start with Telegram events, customer permission context and business-system adapters to deliver observable, extensible bot and Mini App workflows.
The project adapter receives Bot API updates and validates the Webhook secret token; the customer domain layer handles verified intent, permission context and business actions.
Parse Bot API updates, validate the secret token and identify entry type while keeping platform detail separate from customer business logic.
Capture whether the user initiated, allowed data and revocation state.
Choose a response, action, Mini App or fallback from customer business rules.
Return the target result or transfer full context to the customer's human system.
The event contract keeps Telegram entry, permission scope, user intent and fallback strategy in one context so customer domain workflows remain stable.
// Customer workflow event contract
{
"type": "user.intent.submitted",
"source": {
"channel": "telegram_bot",
"entry": "user_initiated"
},
"consent": {
"state": "active",
"scope": ["current_task"]
},
"intent": "check_build_status",
"fallback": "human_handoff"
}The domain handler validates entry, permission and input before choosing an automated result or a contextual human handoff.
on user_intent(event):
if event.entry != "user_initiated":
return ignore()
if not consent.allows(event.intent):
return explain_and_stop()
result = workflow.run(event.intent)
if result.needs_human:
return handoff(with_context=True)
return respond(result.safe_view)Platform access, data minimization, fallback and observability work together to support stable automation workflows.
Confirm account capability, platform terms, Webhook secret-token validation and allowed entry points.
Process only what the current task needs and provide a deletion path.
Cover timeout, rate limit, rule failure and human queue state.
Record node outcomes, errors and responsibility paths.
Use the project brief to align entry, business outcome, customer systems and human handoff before integration delivery.