diff --git a/src/utils/detectSpam.ts b/src/utils/detectSpam.ts index 7102cac..0a790ce 100644 --- a/src/utils/detectSpam.ts +++ b/src/utils/detectSpam.ts @@ -6,16 +6,22 @@ import LanguageDetect from 'languagedetect' * A message is classified as spam based on the following criteria: * 1. The message contains a URL i.e., it includes `https://`. * 2. The message is not written in the German language. + * 3. The message contains the domain name dreikoenige.berlin + * 4. The message contains the dollar sign * * Returns a boolean value indicating whether the message is spam (`true`) or not (`false`). */ export const isSpam = (message: string): boolean => { - if (message.includes('https://')) { + if (message.includes('https://') || message.includes('http://') || message.includes('$')) { const lngDetector = new LanguageDetect(); const language = lngDetector.detect(message)[0][0]; return language !== 'german'; } + if (message.includes('dreikoenige.berlin')) { + return true; + } + return false; } \ No newline at end of file