From b9fdc713886925ae41ac411eec4b60ca0a2b063b Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 4 Apr 2025 04:05:34 +0000 Subject: [PATCH] im a professional, promise --- bot.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bot.py b/bot.py index 38d9608..be3de58 100644 --- a/bot.py +++ b/bot.py @@ -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)