From 14a996229664fc668202eedd50cbef62634e9835 Mon Sep 17 00:00:00 2001 From: Karan Sharma Date: Tue, 5 Jan 2016 19:06:28 +0530 Subject: [PATCH] handle case of negative values of seconds --- examples/timerbot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/timerbot.py b/examples/timerbot.py index c900a273f..8d28ae592 100644 --- a/examples/timerbot.py +++ b/examples/timerbot.py @@ -43,7 +43,8 @@ def set(bot, update, args): try: # args[0] should contain the time for the timer in seconds due = int(args[0]) - + if due < 0: + bot.sendMessage(chat_id,text='Sorry we can not go back to future!') def alarm(bot): """ Inner function to send the alarm message """ bot.sendMessage(chat_id, text='Beep!')