ayrat555 / frankenstein

Telegram bot API client for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getUpdates offset should not be unsigned

OlgabrezelPrivate opened this issue · comments

Hi there,
I have built a couple bots in other languages before and just wanted to try writing one in Rust.

What I usually do right on startup is running a getUpdates call with offset = -1 to toss old updates.
Quoting the Bot API docs for the getUpdates method:

The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will forgotten.

In frankenstein, however, GetUpdatesParams.offset has type Option<u32>, so no negative values can be passed.
I believe the type should be changed to a signed type to admit negative offsets.

Thank you :​)

Thank you for reporting.

the type was changed to i64. And the change was released in 0.20.0