Fix a stupidity I made with notifications and update .gitignore
This commit is contained in:
parent
b98654a09e
commit
d2dcfa5824
2 changed files with 11 additions and 5 deletions
12
.gitignore
vendored
12
.gitignore
vendored
|
@ -1,5 +1,11 @@
|
|||
# Python
|
||||
__pycache__/
|
||||
edt.*
|
||||
logs/
|
||||
token.ini
|
||||
venv/
|
||||
|
||||
# Logs
|
||||
logs/
|
||||
|
||||
# Bot private
|
||||
edt
|
||||
edt.*
|
||||
token.ini
|
||||
|
|
|
@ -28,8 +28,8 @@ class User:
|
|||
now = get_now()
|
||||
c = self.calendar(pass_week=False)
|
||||
for e in c.timeline:
|
||||
if 0 <= (e.begin - now).total_seconds().__abs__() // 60 <= self.nt_time and \
|
||||
0 <= (now - self.nt_last).total_seconds() // 60 >= self.nt_cooldown:
|
||||
if 0 < (e.begin - now).total_seconds() // 60 <= self.nt_time and \
|
||||
0 < (now - self.nt_last).total_seconds() // 60 >= self.nt_cooldown:
|
||||
self.nt_last = get_now()
|
||||
return e
|
||||
return None
|
||||
|
|
Reference in a new issue