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
|