diff --git a/CHANGELOG.md b/CHANGELOG.md index d9062ff..ee93ad9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v1.13.3 (2025-01-11) + +- add option `WithInitialOffset(offset int64)` - allows to set initial offset for getUpdates method + ## v1.13.2 (2025-01-11) - change field type `WebAppUser.ID` from `int` to `int64` diff --git a/README.md b/README.md index b800ed2..7b05fa7 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,7 @@ b, err := bot.New("YOUR_BOT_TOKEN_FROM_BOTFATHER", opts...) - `WithWorkers` - set the number of workers that are processing the Updates channel, by default 1 - `UseTestEnvironment()` - use test environment - `WithNotAsyncHandlers()` - allows to run handlers in the main goroutine +- `WithInitialOffset(offset int64)` - allows to set initial offset for getUpdates method ## Message.Text and CallbackQuery.Data handlers diff --git a/options.go b/options.go index 720129e..0530ab1 100644 --- a/options.go +++ b/options.go @@ -138,3 +138,10 @@ func WithNotAsyncHandlers() Option { b.notAsyncHandlers = true } } + +// WithInitialOffset allows to set initial offset for getUpdates method +func WithInitialOffset(offset int64) Option { + return func(b *Bot) { + b.lastUpdateID = offset + } +}