mirror of
https://github.com/usememos/memos.git
synced 2024-11-11 01:12:40 +08:00
9987337eca
Fix all ID from int to int64 to avoid 32bits machine break
23 lines
424 B
Go
23 lines
424 B
Go
package telegram
|
|
|
|
import (
|
|
"context"
|
|
"net/url"
|
|
"strconv"
|
|
)
|
|
|
|
// GetUpdates make a getUpdates api request.
|
|
func (b *Bot) GetUpdates(ctx context.Context, offset int64) ([]Update, error) {
|
|
formData := url.Values{
|
|
"timeout": {"60"},
|
|
"offset": {strconv.FormatInt(offset, 10)},
|
|
}
|
|
|
|
var result []Update
|
|
err := b.postForm(ctx, "/getUpdates", formData, &result)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return result, nil
|
|
}
|