im a professional, promise
This commit is contained in:
parent
b3bff693dc
commit
b9fdc71388
5
bot.py
5
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,8 +163,7 @@ class IRCBot():
|
||||
continue
|
||||
channel_time = self.check_time(channel)
|
||||
now = time()
|
||||
if self.counter(channel) < messages_within_timeout:
|
||||
if now - channel_time > timeout:
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user