@@ -1182,31 +1182,27 @@ def editMessageReplyMarkup(
1182
1182
return url , data
1183
1183
1184
1184
@log
1185
- def getUpdates (self , offset = None , limit = 100 , timeout = 0 , network_delay = .2 , ** kwargs ):
1185
+ def getUpdates (self , offset = None , limit = 100 , timeout = 0 , network_delay = 5. , ** kwargs ):
1186
1186
"""Use this method to receive incoming updates using long polling.
1187
1187
1188
1188
Args:
1189
- offset:
1190
- Identifier of the first update to be returned. Must be greater by
1191
- one than the highest among the identifiers of previously received
1192
- updates. By default, updates starting with the earliest unconfirmed
1193
- update are returned. An update is considered confirmed as soon as
1194
- getUpdates is called with an offset higher than its update_id.
1195
- limit:
1196
- Limits the number of updates to be retrieved. Values between 1-100
1197
- are accepted. Defaults to 100.
1198
- timeout:
1199
- Timeout in seconds for long polling. Defaults to 0, i.e. usual
1200
- short polling.
1201
- network_delay:
1202
- Additional timeout in seconds to allow the response from Telegram
1203
- to take some time when using long polling. Defaults to 2, which
1204
- should be enough for most connections. Increase it if it takes very
1205
- long for data to be transmitted from and to the Telegram servers.
1189
+ offset (Optional[int]):
1190
+ Identifier of the first update to be returned. Must be greater by one than the highest
1191
+ among the identifiers of previously received updates. By default, updates starting with
1192
+ the earliest unconfirmed update are returned. An update is considered confirmed as soon
1193
+ as getUpdates is called with an offset higher than its update_id.
1194
+ limit (Optional[int]):
1195
+ Limits the number of updates to be retrieved. Values between 1-100 are accepted.
1196
+ Defaults to 100.
1197
+ timeout (Optional[int]):
1198
+ Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling.
1199
+ network_delay (Optional[float]):
1200
+ Additional timeout in seconds to allow the response from Telegram servers. This should
1201
+ cover network latency around the globe, SSL handshake and slowness of the Telegram
1202
+ servers (which unfortunately happens a lot recently - 2016-05-28). Defaults to 5.
1206
1203
1207
1204
Returns:
1208
- list[:class:`telegram.Update`]: A list of :class:`telegram.Update`
1209
- objects are returned.
1205
+ list[:class:`telegram.Update`]
1210
1206
1211
1207
Raises:
1212
1208
:class:`telegram.TelegramError`
0 commit comments