update mess

This commit is contained in:
Admin 2025-09-26 16:09:31 +07:00
parent 068f921efd
commit cff2bc5c33
2 changed files with 9 additions and 2 deletions

View File

@ -14,5 +14,5 @@ export function isBase64(str: string): boolean {
// // Kiểm tra: độ dài chia hết cho 4 và regex khớp
// return cleanedStr.length % 4 === 0 && base64Regex.test(cleanedStr);
return a(str, { urlSafe: false }) && str.length > 100;
return a(str, { urlSafe: false }) && str.length > 50;
}

View File

@ -279,7 +279,7 @@ export class MessagesService {
result: Message,
): string => {
const imageUris: string[] = [];
const textMessages: string[] = [];
let textMessages: string[] = [];
const fileLinks: string[] = []; // Chứa danh sách file dạng [name](url)
for (const msg of msgs) {
@ -304,6 +304,13 @@ export class MessagesService {
textMessages.push(formatTextIfValid(msg));
}
// Loại bỏ các tin nhắn thừa msg: ImageImageImage
const textIsImages = imageUris.map((img) => 'Image').join('');
if (textMessages.includes(textIsImages)) {
textMessages = textMessages.filter((msg) => msg !== textIsImages);
}
// ==== Build nội dung cuối ====
let finalContent = `** :rocket: ${result.name} sent - ${formatTimeAU(result.time_raw)}:**\n`;