| 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 | |