Add reply, quote, and botUserId types to inbound

This commit is contained in:
EugeneTes
2026-09-22 08:38:54 +00:00
parent 90bcb6fd1f
commit 0febacfee7

View File

@@ -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<unknown>;
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 {