telepot
telepot copied to clipboard
getUpdates Passing offset parameter still getting the same old message
Hello i have encountered this issue while using getupdates method with offset value 100000001, it is supposed not to give me the old messages, but still is giving me the old message i will share down my code and the output. I don't know what is wrong if my code or if it is a bug.
bot.getUpdates(offset=100000001)
the out put i am having is:
>>> response = bot.getUpdates(offset=100000001)
>>> pprint(response)
[{'message': {'chat': {'first_name': 'jose',
'id': 999999999,
'last_name': 'tandavala',
'type': 'private',
'username': 'ze_tanda'},
'date': 1515496345,
'from': {'first_name': 'jose',
'id': 999999999,
'is_bot': False,
'language_code': 'en-US',
'last_name': 'tandavala',
'username': 'ze_tanda'},
'message_id': 213,
'text': 'Ola mundo'},
'update_id': 100000000},
@AyumuKasuga @quasiyoke @AyumuKasuga @aragaer @zumoshi @boxama
Please try to make getUpdates
request using curl
with this instruction Only if Telegram does answer you with other data it's the problem with the telepot.
Hello! I've just got the exactly same behavior. Following @quasiyoke suggetion got me the same results. So, after reading the Telegram API documentation (https://core.telegram.org/bots/api#getting-updates) I've found this sentence about "offset":
Must be greater by one than the highest among the identifiers of previously received updates.
And so it is, if your last update_id is 15 and your offset is 17, the API will not "forget" the old message, but if you send 16 as offset then it will.