We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b5c55a commit 9f27537Copy full SHA for 9f27537
examples/echobot.py
@@ -9,8 +9,11 @@
9
bot = telegram.Bot('TOKEN')
10
11
# This will be our global variable to keep the latest update_id when requesting
12
-# for updates. It starts with the latest update_id available.
13
-LAST_UPDATE_ID = bot.getUpdates()[-1].update_id
+# for updates. It starts with the latest update_id if available.
+try:
14
+ LAST_UPDATE_ID = bot.getUpdates()[-1].update_id
15
+except IndexError:
16
+ LAST_UPDATE_ID = None
17
18
19
def echo():
0 commit comments