Skip to content

Commit

Permalink
- add option WithInitialOffset(offset int64) - allows to set initia…
Browse files Browse the repository at this point in the history
…l offset for getUpdates method (#148)
  • Loading branch information
negasus authored Jan 13, 2025
1 parent 233ff74 commit 337def9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit 337def9

Please sign in to comment.