im a professional, promise
This commit is contained in:
parent
b3bff693dc
commit
b9fdc71388
9
bot.py
9
bot.py
@ -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,10 +163,9 @@ 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
|
||||||
self.write_config()
|
self.write_config()
|
||||||
self.set_time(channel, now)
|
self.set_time(channel, now)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user