im a professional, promise

This commit is contained in:
= 2025-04-04 04:05:34 +00:00
parent b3bff693dc
commit b9fdc71388

5
bot.py
View File

@ -7,7 +7,7 @@ channel_re = re.compile(r"PRIVMSG (#*\w+)")
name_re = re.compile(r"^:([^!]*)!") name_re = re.compile(r"^:([^!]*)!")
# timeout = 86400 # 24 hours # timeout = 86400 # 24 hours
timeout = 30 timeout = 15
messages_within_timeout = 5 messages_within_timeout = 5
host = "localhost" host = "localhost"
port = 6667 port = 6667
@ -163,8 +163,7 @@ class IRCBot():
continue continue
channel_time = self.check_time(channel) channel_time = self.check_time(channel)
now = time() now = time()
if self.counter(channel) < messages_within_timeout: if now - channel_time > timeout and self.counter(channel) < messages_within_timeout:
if now - channel_time > timeout:
self.send("#bots", f"i hear activity in {channel}...") self.send("#bots", f"i hear activity in {channel}...")
# self.send("#tildetown", f"i hear activity in {channel}...") # self.send("#tildetown", f"i hear activity in {channel}...")
self.config["counts"][channel] = 0 self.config["counts"][channel] = 0