File tree Expand file tree Collapse file tree 3 files changed +3
-4
lines changed
Expand file tree Collapse file tree 3 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ The following wonderful people contributed directly or indirectly to this projec
1414- `JASON0916 <https://github.com/JASON0916 >`_
1515- `JRoot3D <https://github.com/JRoot3D >`_
1616- `macrojames <https://github.com/macrojames >`_
17+ - `Rahiel Kasim <https://github.com/rahiel >`_
1718- `sooyhwang <https://github.com/sooyhwang >`_
1819- `wjt <https://github.com/wjt >`_
1920
Original file line number Diff line number Diff line change 1919
2020import logging
2121import telegram
22- import time
2322
2423
2524LAST_UPDATE_ID = None
@@ -43,14 +42,13 @@ def main():
4342
4443 while True :
4544 echo (bot )
46- time .sleep (3 )
4745
4846
4947def echo (bot ):
5048 global LAST_UPDATE_ID
5149
5250 # Request updates after the last updated_id
53- for update in bot .getUpdates (offset = LAST_UPDATE_ID ):
51+ for update in bot .getUpdates (offset = LAST_UPDATE_ID , timeout = 10 ):
5452 # chat_id is required to reply any message
5553 chat_id = update .message .chat_id
5654 message = update .message .text .encode ('utf-8' )
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ def main():
3333 LAST_UPDATE_ID = bot .getUpdates ()[- 1 ].update_id # Get lastest update
3434
3535 while True :
36- for update in bot .getUpdates (offset = LAST_UPDATE_ID ):
36+ for update in bot .getUpdates (offset = LAST_UPDATE_ID , timeout = 10 ):
3737 text = update .message .text
3838 chat_id = update .message .chat .id
3939 update_id = update .update_id
You can’t perform that action at this time.
0 commit comments