diff --git a/main.py b/main.py index 0f58baa..0a5a030 100644 --- a/main.py +++ b/main.py @@ -68,6 +68,7 @@ def addTask(bot, update, args): update.message.reply_text('A task already exists under this name') except Exception as e: update.message.reply_text('Wrong format. Send /help for more details') + chats[ident] = chat # except: # update.message.reply_text('Wrong format') diff --git a/task.py b/task.py index 85a9cd7..2967e13 100644 --- a/task.py +++ b/task.py @@ -17,12 +17,12 @@ class Task(object): date = date.replace(year=y) if m > 0: - while now >= datetime(date.year, m, date.day, date.hour) and not fixed: + while now > datetime(date.year, m, date.day, date.hour) and not fixed: date = date.replace(year=(date.year+1)) date = date.replace(month=m) if d > 0: - if now >= datetime(date.year, date.month, d, date.hour) and not fixed: + if now > datetime(date.year, date.month, d, date.hour) and not fixed: _, delta = monthrange(date.year, date.month) date += timedelta(delta) # Days of date.month date = date.replace(day=d) @@ -31,6 +31,8 @@ class Task(object): if now >= datetime(date.year, date.month, date.day, h) and not fixed: date += timedelta(1) date = datetime(date.year, date.month, date.day, h) + else: + date = datetime(date.year, date.month, date.day, date.hour+1) while now >= date and self.repeat > 0: date += timedelta(self.repeat)