fix(telegram): unify inbound handling for message-like updates (#20591)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 442a100071
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
This commit is contained in:
Ayaan Zaidi
2026-02-19 09:54:47 +05:30
committed by GitHub
parent 6b05916c14
commit d17a1f387b
5 changed files with 181 additions and 161 deletions

View File

@@ -66,9 +66,13 @@ export function getTelegramSequentialKey(ctx: {
chat?: { id?: number };
me?: UserFromGetMe;
message?: Message;
channelPost?: Message;
editedChannelPost?: Message;
update?: {
message?: Message;
edited_message?: Message;
channel_post?: Message;
edited_channel_post?: Message;
callback_query?: { message?: Message };
message_reaction?: { chat?: { id?: number } };
};
@@ -80,8 +84,12 @@ export function getTelegramSequentialKey(ctx: {
}
const msg =
ctx.message ??
ctx.channelPost ??
ctx.editedChannelPost ??
ctx.update?.message ??
ctx.update?.edited_message ??
ctx.update?.channel_post ??
ctx.update?.edited_channel_post ??
ctx.update?.callback_query?.message;
const chatId = msg?.chat?.id ?? ctx.chat?.id;
const rawText = msg?.text ?? msg?.caption;