im a professional, promise

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

9
bot.py
View File

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