This commit is contained in:
Zodiac 2025-02-12 23:15:50 -08:00
parent 77373d36c4
commit 8eaa321840

View File

@ -89,7 +89,15 @@ class AntiSpam:
Returns:
bool: True if the message is considered spam, False otherwise.
"""
user = self.user_data[nick.lower()]
nick = nick.lower()
if nick not in self.user_data:
self.user_data[nick] = {
'messages': deque(maxlen=int(self.config.get('repeat_limit', 3))),
'timestamps': deque(maxlen=int(self.config.get('spam_limit', 5))),
'mentions': deque(maxlen=int(self.config.get('mention_limit', 2)))
}
user = self.user_data[nick]
now = time.time()
# Check message length