diff --git a/apps/cron/src/services/PostService/index.mts b/apps/cron/src/services/PostService/index.mts index c1cec853..2be0053f 100644 --- a/apps/cron/src/services/PostService/index.mts +++ b/apps/cron/src/services/PostService/index.mts @@ -179,11 +179,18 @@ export class PostService implements Service { ): Promise<{ isSpam: boolean; reason: string }> { const includesCN = /[\u4e00-\u9fa5]/.test(text) const includesKR = /[ㄱ-ㅎ|ㅏ-ㅣ|가-힣]/.test(text) + const includesVN = /[àáâãèéêìíòóôõùúýăđĩũơưạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹ]/.test( + text, + ) if (includesCN && !includesKR) { return { isSpam: true, reason: 'includesCN' } } + if (includesVN && !includesKR) { + return { isSpam: true, reason: 'includesVN' } + } + let replaced = text.replace(/```([\s\S]*?)```/g, '') // remove code blocks // replace image markdown replaced = replaced.replace(/!\[([\s\S]*?)\]\(([\s\S]*?)\)/g, '')