feat(bot): support tagged assistant replies in topics

This commit is contained in:
2026-03-11 12:15:56 +04:00
parent 9553ca342a
commit fce2d30beb
7 changed files with 587 additions and 93 deletions

View File

@@ -15,6 +15,7 @@ import {
parsePaymentProposalPayload,
synthesizePaymentConfirmationText
} from './payment-proposals'
import { stripExplicitBotMention } from './telegram-mentions'
const PAYMENT_TOPIC_CONFIRM_CALLBACK_PREFIX = 'payment_topic:confirm:'
const PAYMENT_TOPIC_CANCEL_CALLBACK_PREFIX = 'payment_topic:cancel:'
@@ -95,7 +96,7 @@ function attachmentCount(ctx: Context): number {
function toCandidateFromContext(ctx: Context): PaymentTopicCandidate | null {
const message = ctx.message
const rawText = readMessageText(ctx)
const rawText = stripExplicitBotMention(ctx)?.strippedText ?? readMessageText(ctx)
if (!message || !rawText) {
return null
}