update mess
This commit is contained in:
parent
068f921efd
commit
cff2bc5c33
|
|
@ -14,5 +14,5 @@ export function isBase64(str: string): boolean {
|
||||||
// // Kiểm tra: độ dài chia hết cho 4 và regex khớp
|
// // Kiểm tra: độ dài chia hết cho 4 và regex khớp
|
||||||
// return cleanedStr.length % 4 === 0 && base64Regex.test(cleanedStr);
|
// return cleanedStr.length % 4 === 0 && base64Regex.test(cleanedStr);
|
||||||
|
|
||||||
return a(str, { urlSafe: false }) && str.length > 100;
|
return a(str, { urlSafe: false }) && str.length > 50;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ export class MessagesService {
|
||||||
result: Message,
|
result: Message,
|
||||||
): string => {
|
): string => {
|
||||||
const imageUris: string[] = [];
|
const imageUris: string[] = [];
|
||||||
const textMessages: string[] = [];
|
let textMessages: string[] = [];
|
||||||
const fileLinks: string[] = []; // Chứa danh sách file dạng [name](url)
|
const fileLinks: string[] = []; // Chứa danh sách file dạng [name](url)
|
||||||
|
|
||||||
for (const msg of msgs) {
|
for (const msg of msgs) {
|
||||||
|
|
@ -304,6 +304,13 @@ export class MessagesService {
|
||||||
textMessages.push(formatTextIfValid(msg));
|
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 ====
|
// ==== Build nội dung cuối ====
|
||||||
let finalContent = `** :rocket: ${result.name} sent - ${formatTimeAU(result.time_raw)}:**\n`;
|
let finalContent = `** :rocket: ${result.name} sent - ${formatTimeAU(result.time_raw)}:**\n`;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue