X Tutup
Skip to content

Commit fc64cc0

Browse files
committed
Merge pull request python-telegram-bot#148 from mr-karan/patch-1
handle case of negative values of seconds
2 parents 4197400 + 14a9962 commit fc64cc0

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