improvements, fixes

This commit is contained in:
2026-04-29 19:48:38 +03:00
parent c003d443e3
commit a7fcb8074c
5 changed files with 33 additions and 8 deletions
+14 -1
View File
@@ -312,6 +312,8 @@ export async function sendMessage(options: SendOptions): Promise<Message> {
reply_markup: options.reply_markup,
});
await MessageStore.put(response);
return Promise.resolve(response);
}
@@ -338,6 +340,8 @@ export async function replyToMessage(options: SendOptions): Promise<Message> {
link_preview_options: options.link_preview_options
});
await MessageStore.put(response);
return Promise.resolve(response);
}
@@ -563,7 +567,14 @@ function escapeMarkdownV2PreservingAllowedFormatting(s: string): string {
}
function unescapeAccidentalMarkdownV2(s: string): string {
return s.replace(/\\([_*\[\]()~`>#+\-=|{}.!\\])/g, "$1");
let prev: string;
do {
prev = s;
s = s.replace(/\\([_*\[\]()~`>#+\-=|{}.!\\])/g, "$1");
} while (s !== prev);
return s;
}
function escapeTelegramQuoteLine(line: string): string {
@@ -726,6 +737,8 @@ export function cutPrefixes(msg: Message | StoredMessage | string): string {
});
const text = extractTextMessage(msg);
if (!text || !text.length) return "";
let newText = text;
for (const prefix of prefixes) {