From 0febacfee76cca69a55265d84741baaf0e2df8c5 Mon Sep 17 00:00:00 2001 From: EugeneTes Date: Tue, 22 Sep 2026 08:38:54 +0000 Subject: [PATCH] Add reply, quote, and botUserId types to inbound --- src/telegram/inbound.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/telegram/inbound.ts b/src/telegram/inbound.ts index d865ad3..10fa3ee 100644 --- a/src/telegram/inbound.ts +++ b/src/telegram/inbound.ts @@ -9,6 +9,24 @@ export type ForwardOrigin = | { type: "chat"; sender_chat: { title?: string; username?: string }; author_signature?: string } | { type: "channel"; chat: { title?: string; username?: string }; author_signature?: string }; +export interface RepliedMessage { + from?: { id: number; is_bot?: boolean }; + text?: string; + caption?: string; + photo?: Array; + voice?: unknown; + audio?: { file_name?: string }; + document?: { file_name?: string }; +} + +export interface Quote { + text: string; + is_manual?: boolean; +} + +/** Longest replied-to text (or quote) we inline into the header before truncating with an ellipsis. */ +export const MAX_REPLY_CONTEXT_CHARS = 500; + export interface InboundMessage { text?: string; caption?: string; @@ -17,6 +35,8 @@ export interface InboundMessage { audio?: { file_id: string; mime_type?: string; file_name?: string }; document?: { file_id: string; file_name?: string; mime_type?: string }; forward_origin?: ForwardOrigin; + reply_to_message?: RepliedMessage; + quote?: Quote; } export interface InboundDeps { @@ -24,6 +44,8 @@ export interface InboundDeps { transcriber?: Transcriber; workspaceDir: string; now?: () => Date; + /** The bot's own user id, for labelling replies to bot vs owner messages. */ + botUserId?: number; } export interface InboundResult {