File size: 569 Bytes
2b9435d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

import re

def is_spam(message: str) -> bool:
    # Check for typical spam patterns related to money and URLs
    money_keywords = ['๋งŒ์›', '๋ฐฑ๋งŒ์›', '์‹ ์†', '์ง€์›๊ธˆ', 'ํ• ์ธ', 'ํ˜œํƒ', '๋งˆ๊ฐ']
    spam_url_pattern = re.compile(r'(https?:\/\/\S*[์ •๋ณดํˆฌ์ž]|\S*(bit\.ly|me2\.kr|asq\.kr|openkakao)\S*)')
    
    if any(keyword in message for keyword in money_keywords) or re.search(spam_url_pattern, message):
        return True
    
    # Check for advertisement tag in the message
    if "(๊ด‘๊ณ )" in message:
        return True

    return False