X Tutup
Skip to content

Commit 14a9962

Browse files
committed
handle case of negative values of seconds
1 parent 4197400 commit 14a9962

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/timerbot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def set(bot, update, args):
4343
try:
4444
# args[0] should contain the time for the timer in seconds
4545
due = int(args[0])
46-
46+
if due < 0:
47+
bot.sendMessage(chat_id,text='Sorry we can not go back to future!')
4748
def alarm(bot):
4849
""" Inner function to send the alarm message """
4950
bot.sendMessage(chat_id, text='Beep!')

0 commit comments

Comments
 (0)
X Tutup