mirror of
https://github.com/lukaszraczylo/go-telegram.git
synced 2026-06-05 22:43:59 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0731f10907 | |||
| 6685414374 | |||
| 404411b20c | |||
| 8d85e61da5 | |||
| 609c4ce649 | |||
| d39be13822 | |||
| d6ecbdea48 | |||
| 99c906c3c5 | |||
| f5250197b7 | |||
| bbbeb8461b | |||
| bfb7e9875e | |||
| 75c7ce3119 |
+25
-25
@@ -25,12 +25,12 @@ jobs:
|
||||
vet:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '1.25.x'
|
||||
check-latest: true
|
||||
- uses: actions/cache@v4
|
||||
- uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
@@ -41,12 +41,12 @@ jobs:
|
||||
staticcheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '1.25.x'
|
||||
check-latest: true
|
||||
- uses: actions/cache@v4
|
||||
- uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
@@ -58,12 +58,12 @@ jobs:
|
||||
govulncheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '1.25.x'
|
||||
check-latest: true
|
||||
- uses: actions/cache@v4
|
||||
- uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
@@ -75,12 +75,12 @@ jobs:
|
||||
gosec:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '1.25.x'
|
||||
check-latest: true
|
||||
- uses: actions/cache@v4
|
||||
- uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
@@ -98,12 +98,12 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '1.25.x'
|
||||
check-latest: true
|
||||
- uses: actions/cache@v4
|
||||
- uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
@@ -112,7 +112,7 @@ jobs:
|
||||
- run: go test -race -coverprofile=coverage.out ./...
|
||||
- name: Build all examples
|
||||
run: go build ./examples/...
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage.out
|
||||
@@ -120,12 +120,12 @@ jobs:
|
||||
codegen-clean:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '1.25.x'
|
||||
check-latest: true
|
||||
- uses: actions/cache@v4
|
||||
- uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
@@ -139,14 +139,14 @@ jobs:
|
||||
audit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0 # need history for drift comparison
|
||||
- uses: actions/setup-go@v5
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '1.25.x'
|
||||
check-latest: true
|
||||
- uses: actions/cache@v4
|
||||
- uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
@@ -196,11 +196,11 @@ jobs:
|
||||
github.event_name == 'workflow_dispatch'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '1.25.x'
|
||||
check-latest: true
|
||||
@@ -258,7 +258,7 @@ jobs:
|
||||
|
||||
- name: Run GoReleaser
|
||||
if: github.event_name != 'workflow_dispatch' || inputs.dry-run-release == false
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
uses: goreleaser/goreleaser-action@v7
|
||||
with:
|
||||
distribution: goreleaser
|
||||
version: '~> v2'
|
||||
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/configure-pages@v5
|
||||
- uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
|
||||
@@ -13,12 +13,12 @@ jobs:
|
||||
regen:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0 # full history so audit -drift can compare against main
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '1.25.x'
|
||||
check-latest: true
|
||||
@@ -89,7 +89,7 @@ jobs:
|
||||
|
||||
- name: Open PR
|
||||
if: steps.diff.outputs.no_changes != 'true'
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
uses: peter-evans/create-pull-request@v8
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: |
|
||||
|
||||
@@ -35,7 +35,10 @@ lint: vet
|
||||
integration:
|
||||
$(GO) test -tags=integration -v ./test/integration/...
|
||||
|
||||
SCRAPE_INPUT ?= testdata/html/snapshot_2026-05-08.html
|
||||
# Resolve via testdata/html/latest.html symlink so the pinned-fixture target
|
||||
# auto-tracks whatever snapshot regen.yml last committed. Override with
|
||||
# SCRAPE_INPUT=path/to/snapshot.html for ad-hoc replays.
|
||||
SCRAPE_INPUT ?= testdata/html/$(shell readlink testdata/html/latest.html)
|
||||
SCRAPE_OUTPUT ?= internal/spec/api.json
|
||||
|
||||
snapshot:
|
||||
|
||||
@@ -326,10 +326,13 @@ Apples-to-apples micro-benchmarks against the five most-starred Go Telegram libr
|
||||
|
||||
| Path | Fastest | Our position |
|
||||
|------|---------|--------------|
|
||||
| Webhook decode (small Update) | **ours** — 1.74 µs / 11 allocs | 1st of 6 |
|
||||
| Large Update unmarshal (unions + reply markup) | **ours** — 6.67 µs / 34 allocs | 1st of 6 |
|
||||
| `sendMessage` round-trip (mock server) | telego — 36.3 µs / 48 allocs | 2nd of 5 |
|
||||
| Dispatcher routing (20 handlers, last matches) | **ours** — 101 ns / 3 allocs | 1st of 3 |
|
||||
| Webhook decode (small Update) | **ours** — 1.83 µs / 11 allocs | 1st of 6 |
|
||||
| Large Update unmarshal (unions + reply markup) | **ours** — 6.73 µs / 34 allocs | 1st of 6 |
|
||||
| `sendMessage` round-trip — `net/http` default | telego — 35.8 µs / 48 allocs | 2nd of 5 (102 allocs) |
|
||||
| `sendMessage` round-trip — opt-in `fasthttp` | telego — 48 allocs | within 8 of telego (56 allocs) |
|
||||
| Dispatcher routing (20 handlers, last matches) | **ours** — 98 ns / 3 allocs | 1st of 3 |
|
||||
|
||||
Opt into fasthttp for high-throughput bots: `client.WithHTTPClient(client.NewFastHTTPDoer())`. Trade-off: HTTP/1.1 only, no `RoundTripper` middleware composition.
|
||||
|
||||
Full tables, caveats, and reproduction steps: **[`docs/benchmarks/2026-05-10-comparison.md`](docs/benchmarks/2026-05-10-comparison.md)**.
|
||||
|
||||
@@ -368,6 +371,20 @@ bot := client.New("token", client.WithHTTPClient(fakeDoer{
|
||||
|
||||
The library's own generated test suite (`api/methods_gen_test.go`) covers 176 methods × 8 scenarios each: Success, APIError, NetworkError, ParseError, ContextCanceled, MissingRequiredFields, Forbidden, ServerError.
|
||||
|
||||
## Telemetry
|
||||
|
||||
On the **first call to `client.New`** in a process, this library sends a
|
||||
single anonymous adoption ping — project name, version, timestamp; no
|
||||
identifiers, no message contents, no API call metadata. Fire-and-forget
|
||||
with a 2-second timeout; cannot block `New` or panic.
|
||||
|
||||
Local source: [`client/telemetry.go`](client/telemetry.go). Upstream
|
||||
implementation, exact wire format, and full opt-out documentation:
|
||||
**[oss-telemetry — Disabling telemetry](https://github.com/lukaszraczylo/oss-telemetry#disabling-telemetry)**.
|
||||
|
||||
Quick opt-out: set any of `DO_NOT_TRACK=1`, `OSS_TELEMETRY_DISABLED=1`,
|
||||
or `GO_TELEGRAM_DISABLE_TELEMETRY=1`.
|
||||
|
||||
## Contributing
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
||||
|
||||
+77
-77
@@ -45,7 +45,7 @@ func GetUpdates(ctx context.Context, b *client.Bot, p *GetUpdatesParams) ([]Upda
|
||||
// Notes1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.3. Ports currently supported for webhooks: 443, 80, 88, 8443.
|
||||
// If you're having any trouble setting up webhooks, please check out this amazing guide to webhooks.
|
||||
type SetWebhookParams struct {
|
||||
// HTTPS URL to send updates to. Use an empty string to remove webhook integration
|
||||
// HTTPS URL to send updates to. Use an empty string to remove webhook integration.
|
||||
URL string `json:"url"`
|
||||
// Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details.
|
||||
Certificate *InputFile `json:"certificate,omitempty"`
|
||||
@@ -215,7 +215,7 @@ type SendMessageParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ type CopyMessageParams struct {
|
||||
MessageID int64 `json:"message_id"`
|
||||
// New start timestamp for the copied video in the message
|
||||
VideoStartTimestamp *int64 `json:"video_start_timestamp,omitempty"`
|
||||
// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
|
||||
// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept.
|
||||
Caption string `json:"caption,omitempty"`
|
||||
// Mode for parsing entities in the new caption. See formatting options for more details.
|
||||
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
||||
@@ -322,7 +322,7 @@ type CopyMessageParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ type SendPhotoParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -671,7 +671,7 @@ type SendAudioParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -813,7 +813,7 @@ type SendDocumentParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -962,7 +962,7 @@ type SendVideoParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -1133,7 +1133,7 @@ type SendAnimationParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -1278,7 +1278,7 @@ type SendVoiceParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -1379,7 +1379,7 @@ type SendVideoNoteParams struct {
|
||||
MessageThreadID *int64 `json:"message_thread_id,omitempty"`
|
||||
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
|
||||
DirectMessagesTopicID *int64 `json:"direct_messages_topic_id,omitempty"`
|
||||
// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported
|
||||
// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported.
|
||||
VideoNote *InputFile `json:"video_note"`
|
||||
// Duration of sent video in seconds
|
||||
Duration *int64 `json:"duration,omitempty"`
|
||||
@@ -1399,7 +1399,7 @@ type SendVideoNoteParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -1526,7 +1526,7 @@ type SendPaidMediaParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -1707,7 +1707,7 @@ type SendLocationParams struct {
|
||||
Longitude float64 `json:"longitude"`
|
||||
// The radius of uncertainty for the location, measured in meters; 0-1500
|
||||
HorizontalAccuracy *float64 `json:"horizontal_accuracy,omitempty"`
|
||||
// Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
|
||||
// Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely
|
||||
LivePeriod *int64 `json:"live_period,omitempty"`
|
||||
// For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
|
||||
Heading *int64 `json:"heading,omitempty"`
|
||||
@@ -1725,7 +1725,7 @@ type SendLocationParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -1776,7 +1776,7 @@ type SendVenueParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -1819,7 +1819,7 @@ type SendContactParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -1842,9 +1842,9 @@ type SendPollParams struct {
|
||||
MessageThreadID *int64 `json:"message_thread_id,omitempty"`
|
||||
// Poll question, 1-300 characters
|
||||
Question string `json:"question"`
|
||||
// Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed
|
||||
// Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed.
|
||||
QuestionParseMode ParseMode `json:"question_parse_mode,omitempty"`
|
||||
// A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode
|
||||
// A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode.
|
||||
QuestionEntities []MessageEntity `json:"question_entities,omitempty"`
|
||||
// A JSON-serialized list of 1-12 answer options
|
||||
Options []InputPollOption `json:"options"`
|
||||
@@ -1864,7 +1864,7 @@ type SendPollParams struct {
|
||||
HideResultsUntilCloses *bool `json:"hide_results_until_closes,omitempty"`
|
||||
// Pass True, if voting is limited to users who have been members of the chat where the poll is being sent for more than 24 hours; for channel chats only
|
||||
MembersOnly *bool `json:"members_only,omitempty"`
|
||||
// A JSON-serialized list of 0-12 two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll; for channel chats only. If omitted or empty, then users from any country can participate in the poll.
|
||||
// A JSON-serialized list of 0-12 two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll; for channel chats only. Use “FT” as a country code to allow users with anonymous numbers to vote. If omitted or empty, then users from any country can participate in the poll.
|
||||
CountryCodes []string `json:"country_codes,omitempty"`
|
||||
// A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, required for polls in quiz mode
|
||||
CorrectOptionIds []int64 `json:"correct_option_ids,omitempty"`
|
||||
@@ -1872,7 +1872,7 @@ type SendPollParams struct {
|
||||
Explanation string `json:"explanation,omitempty"`
|
||||
// Mode for parsing entities in the explanation. See formatting options for more details.
|
||||
ExplanationParseMode ParseMode `json:"explanation_parse_mode,omitempty"`
|
||||
// A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode
|
||||
// A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode.
|
||||
ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"`
|
||||
// Media added to the quiz explanation
|
||||
ExplanationMedia InputPollMedia `json:"explanation_media,omitempty"`
|
||||
@@ -1900,7 +1900,7 @@ type SendPollParams struct {
|
||||
MessageEffectID string `json:"message_effect_id,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -1952,7 +1952,7 @@ type SendDiceParams struct {
|
||||
MessageThreadID *int64 `json:"message_thread_id,omitempty"`
|
||||
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
|
||||
DirectMessagesTopicID *int64 `json:"direct_messages_topic_id,omitempty"`
|
||||
// Emoji on which the dice throw animation is based. Currently, must be one of “”, “”, “”, “”, “”, or “”. Dice can have values 1-6 for “”, “” and “”, values 1-5 for “” and “”, and values 1-64 for “”. Defaults to “”
|
||||
// Emoji on which the dice throw animation is based. Currently, must be one of “”, “”, “”, “”, “”, or “”. Dice can have values 1-6 for “”, “” and “”, values 1-5 for “” and “”, and values 1-64 for “”. Defaults to “”.
|
||||
Emoji DiceEmoji `json:"emoji,omitempty"`
|
||||
// Sends the message silently. Users will receive a notification with no sound.
|
||||
DisableNotification *bool `json:"disable_notification,omitempty"`
|
||||
@@ -1966,7 +1966,7 @@ type SendDiceParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -2010,7 +2010,7 @@ func SendMessageDraft(ctx context.Context, b *client.Bot, p *SendMessageDraftPar
|
||||
type SendChatActionParams struct {
|
||||
// Unique identifier of the business connection on behalf of which the action will be sent
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Channel chats and channel direct messages chats aren't supported.
|
||||
// Unique identifier for the target chat or username of the target bot or supergroup in the format @username. Channel chats and channel direct messages chats aren't supported.
|
||||
ChatID ChatID `json:"chat_id"`
|
||||
// Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only
|
||||
MessageThreadID *int64 `json:"message_thread_id,omitempty"`
|
||||
@@ -2174,7 +2174,7 @@ type RestrictChatMemberParams struct {
|
||||
Permissions ChatPermissions `json:"permissions"`
|
||||
// Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.
|
||||
UseIndependentChatPermissions *bool `json:"use_independent_chat_permissions,omitempty"`
|
||||
// Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever
|
||||
// Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever.
|
||||
UntilDate *int64 `json:"until_date,omitempty"`
|
||||
}
|
||||
|
||||
@@ -2201,7 +2201,7 @@ type PromoteChatMemberParams struct {
|
||||
CanDeleteMessages *bool `json:"can_delete_messages,omitempty"`
|
||||
// Pass True if the administrator can manage video chats
|
||||
CanManageVideoChats *bool `json:"can_manage_video_chats,omitempty"`
|
||||
// Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators
|
||||
// Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators.
|
||||
CanRestrictMembers *bool `json:"can_restrict_members,omitempty"`
|
||||
// Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)
|
||||
CanPromoteMembers *bool `json:"can_promote_members,omitempty"`
|
||||
@@ -2356,7 +2356,7 @@ type CreateChatInviteLinkParams struct {
|
||||
ExpireDate *int64 `json:"expire_date,omitempty"`
|
||||
// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
|
||||
MemberLimit *int64 `json:"member_limit,omitempty"`
|
||||
// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified
|
||||
// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified.
|
||||
CreatesJoinRequest *bool `json:"creates_join_request,omitempty"`
|
||||
}
|
||||
|
||||
@@ -2381,7 +2381,7 @@ type EditChatInviteLinkParams struct {
|
||||
ExpireDate *int64 `json:"expire_date,omitempty"`
|
||||
// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
|
||||
MemberLimit *int64 `json:"member_limit,omitempty"`
|
||||
// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified
|
||||
// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified.
|
||||
CreatesJoinRequest *bool `json:"creates_join_request,omitempty"`
|
||||
}
|
||||
|
||||
@@ -2801,7 +2801,7 @@ type CreateForumTopicParams struct {
|
||||
ChatID ChatID `json:"chat_id"`
|
||||
// Topic name, 1-128 characters
|
||||
Name string `json:"name"`
|
||||
// Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F)
|
||||
// Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F).
|
||||
IconColor *int64 `json:"icon_color,omitempty"`
|
||||
// Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers.
|
||||
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
|
||||
@@ -2822,9 +2822,9 @@ type EditForumTopicParams struct {
|
||||
ChatID ChatID `json:"chat_id"`
|
||||
// Unique identifier for the target message thread of the forum topic
|
||||
MessageThreadID int64 `json:"message_thread_id"`
|
||||
// New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept
|
||||
// New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept.
|
||||
Name string `json:"name,omitempty"`
|
||||
// New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept
|
||||
// New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept.
|
||||
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
|
||||
}
|
||||
|
||||
@@ -3002,7 +3002,7 @@ func UnpinAllGeneralForumTopicMessages(ctx context.Context, b *client.Bot, p *Un
|
||||
type AnswerCallbackQueryParams struct {
|
||||
// Unique identifier for the query to be answered
|
||||
CallbackQueryID string `json:"callback_query_id"`
|
||||
// Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters
|
||||
// Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters.
|
||||
Text string `json:"text,omitempty"`
|
||||
// If True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
|
||||
ShowAlert *bool `json:"show_alert,omitempty"`
|
||||
@@ -3141,7 +3141,7 @@ type SetMyCommandsParams struct {
|
||||
Commands []BotCommand `json:"commands"`
|
||||
// A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
|
||||
Scope BotCommandScope `json:"scope,omitempty"`
|
||||
// A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
|
||||
// A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands.
|
||||
LanguageCode string `json:"language_code,omitempty"`
|
||||
}
|
||||
|
||||
@@ -3158,7 +3158,7 @@ func SetMyCommands(ctx context.Context, b *client.Bot, p *SetMyCommandsParams) (
|
||||
type DeleteMyCommandsParams struct {
|
||||
// A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
|
||||
Scope BotCommandScope `json:"scope,omitempty"`
|
||||
// A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
|
||||
// A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands.
|
||||
LanguageCode string `json:"language_code,omitempty"`
|
||||
}
|
||||
|
||||
@@ -3314,9 +3314,9 @@ func RemoveMyProfilePhoto(ctx context.Context, b *client.Bot, p *RemoveMyProfile
|
||||
//
|
||||
// Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
|
||||
type SetChatMenuButtonParams struct {
|
||||
// Unique identifier for the target private chat. If not specified, default bot's menu button will be changed
|
||||
// Unique identifier for the target private chat. If not specified, the bot's default menu button will be changed.
|
||||
ChatID *int64 `json:"chat_id,omitempty"`
|
||||
// A JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault
|
||||
// A JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault.
|
||||
MenuButton MenuButton `json:"menu_button,omitempty"`
|
||||
}
|
||||
|
||||
@@ -3331,7 +3331,7 @@ func SetChatMenuButton(ctx context.Context, b *client.Bot, p *SetChatMenuButtonP
|
||||
//
|
||||
// Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.
|
||||
type GetChatMenuButtonParams struct {
|
||||
// Unique identifier for the target private chat. If not specified, default bot's menu button will be returned
|
||||
// Unique identifier for the target private chat. If not specified, the bot's default menu button will be returned.
|
||||
ChatID *int64 `json:"chat_id,omitempty"`
|
||||
}
|
||||
|
||||
@@ -3532,7 +3532,7 @@ func ReadBusinessMessage(ctx context.Context, b *client.Bot, p *ReadBusinessMess
|
||||
type DeleteBusinessMessagesParams struct {
|
||||
// Unique identifier of the business connection on behalf of which to delete the messages
|
||||
BusinessConnectionID string `json:"business_connection_id"`
|
||||
// A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted
|
||||
// A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted.
|
||||
MessageIds []int64 `json:"message_ids"`
|
||||
}
|
||||
|
||||
@@ -3707,7 +3707,7 @@ type GetBusinessAccountGiftsParams struct {
|
||||
SortByPrice *bool `json:"sort_by_price,omitempty"`
|
||||
// Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
|
||||
Offset string `json:"offset,omitempty"`
|
||||
// The maximum number of gifts to be returned; 1-100. Defaults to 100
|
||||
// The maximum number of gifts to be returned; 1-100. Defaults to 100.
|
||||
Limit *int64 `json:"limit,omitempty"`
|
||||
}
|
||||
|
||||
@@ -3738,7 +3738,7 @@ type GetUserGiftsParams struct {
|
||||
SortByPrice *bool `json:"sort_by_price,omitempty"`
|
||||
// Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
|
||||
Offset string `json:"offset,omitempty"`
|
||||
// The maximum number of gifts to be returned; 1-100. Defaults to 100
|
||||
// The maximum number of gifts to be returned; 1-100. Defaults to 100.
|
||||
Limit *int64 `json:"limit,omitempty"`
|
||||
}
|
||||
|
||||
@@ -3773,7 +3773,7 @@ type GetChatGiftsParams struct {
|
||||
SortByPrice *bool `json:"sort_by_price,omitempty"`
|
||||
// Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
|
||||
Offset string `json:"offset,omitempty"`
|
||||
// The maximum number of gifts to be returned; 1-100. Defaults to 100
|
||||
// The maximum number of gifts to be returned; 1-100. Defaults to 100.
|
||||
Limit *int64 `json:"limit,omitempty"`
|
||||
}
|
||||
|
||||
@@ -3991,7 +3991,7 @@ func SavePreparedInlineMessage(ctx context.Context, b *client.Bot, p *SavePrepar
|
||||
type SavePreparedKeyboardButtonParams struct {
|
||||
// Unique identifier of the target user that can use the button
|
||||
UserID int64 `json:"user_id"`
|
||||
// A JSON-serialized object describing the button to be saved. The button must be of the type request_users, request_chat, or request_managed_bot
|
||||
// A JSON-serialized object describing the button to be saved. The button must be of the type request_users, request_chat, or request_managed_bot.
|
||||
Button KeyboardButton `json:"button"`
|
||||
}
|
||||
|
||||
@@ -4010,9 +4010,9 @@ type EditMessageTextParams struct {
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
|
||||
ChatID *ChatID `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
// New text of the message, 1-4096 characters after entities parsing
|
||||
Text string `json:"text"`
|
||||
@@ -4022,7 +4022,7 @@ type EditMessageTextParams struct {
|
||||
Entities []MessageEntity `json:"entities,omitempty"`
|
||||
// Link preview generation options for the message
|
||||
LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"`
|
||||
// A JSON-serialized object for an inline keyboard.
|
||||
// A JSON-serialized object for an inline keyboard
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -4041,9 +4041,9 @@ type EditMessageCaptionParams struct {
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
|
||||
ChatID *ChatID `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
// New caption of the message, 0-1024 characters after entities parsing
|
||||
Caption string `json:"caption,omitempty"`
|
||||
@@ -4053,7 +4053,7 @@ type EditMessageCaptionParams struct {
|
||||
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
|
||||
// Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages.
|
||||
ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"`
|
||||
// A JSON-serialized object for an inline keyboard.
|
||||
// A JSON-serialized object for an inline keyboard
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -4072,13 +4072,13 @@ type EditMessageMediaParams struct {
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
|
||||
ChatID *ChatID `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
// A JSON-serialized object for a new media content of the message
|
||||
Media InputMedia `json:"media"`
|
||||
// A JSON-serialized object for a new inline keyboard.
|
||||
// A JSON-serialized object for a new inline keyboard
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -4134,15 +4134,15 @@ type EditMessageLiveLocationParams struct {
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
|
||||
ChatID *ChatID `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
// Latitude of new location
|
||||
Latitude float64 `json:"latitude"`
|
||||
// Longitude of new location
|
||||
Longitude float64 `json:"longitude"`
|
||||
// New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged
|
||||
// New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged.
|
||||
LivePeriod *int64 `json:"live_period,omitempty"`
|
||||
// The radius of uncertainty for the location, measured in meters; 0-1500
|
||||
HorizontalAccuracy *float64 `json:"horizontal_accuracy,omitempty"`
|
||||
@@ -4150,7 +4150,7 @@ type EditMessageLiveLocationParams struct {
|
||||
Heading *int64 `json:"heading,omitempty"`
|
||||
// The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
|
||||
ProximityAlertRadius *int64 `json:"proximity_alert_radius,omitempty"`
|
||||
// A JSON-serialized object for a new inline keyboard.
|
||||
// A JSON-serialized object for a new inline keyboard
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -4169,11 +4169,11 @@ type StopMessageLiveLocationParams struct {
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
|
||||
ChatID *ChatID `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the message with live location to stop
|
||||
// Required if inline_message_id is not specified. Identifier of the message with live location to stop.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
// A JSON-serialized object for a new inline keyboard.
|
||||
// A JSON-serialized object for a new inline keyboard
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -4215,11 +4215,11 @@ type EditMessageReplyMarkupParams struct {
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
|
||||
ChatID *ChatID `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
// A JSON-serialized object for an inline keyboard.
|
||||
// A JSON-serialized object for an inline keyboard
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -4240,7 +4240,7 @@ type StopPollParams struct {
|
||||
ChatID ChatID `json:"chat_id"`
|
||||
// Identifier of the original message with the poll
|
||||
MessageID int64 `json:"message_id"`
|
||||
// A JSON-serialized object for a new message inline keyboard.
|
||||
// A JSON-serialized object for a new message inline keyboard
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -4259,7 +4259,7 @@ type ApproveSuggestedPostParams struct {
|
||||
ChatID int64 `json:"chat_id"`
|
||||
// Identifier of a suggested post message to approve
|
||||
MessageID int64 `json:"message_id"`
|
||||
// Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must be not more than 2678400 seconds (30 days) in the future
|
||||
// Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must be not more than 2678400 seconds (30 days) in the future.
|
||||
SendDate *int64 `json:"send_date,omitempty"`
|
||||
}
|
||||
|
||||
@@ -4312,7 +4312,7 @@ func DeleteMessage(ctx context.Context, b *client.Bot, p *DeleteMessageParams) (
|
||||
type DeleteMessagesParams struct {
|
||||
// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
|
||||
ChatID ChatID `json:"chat_id"`
|
||||
// A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted
|
||||
// A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted.
|
||||
MessageIds []int64 `json:"message_ids"`
|
||||
}
|
||||
|
||||
@@ -4327,7 +4327,7 @@ func DeleteMessages(ctx context.Context, b *client.Bot, p *DeleteMessagesParams)
|
||||
//
|
||||
// Use this method to remove a reaction from a message in a group or a supergroup chat. The bot must have the 'can_delete_messages' administrator right in the chat. Returns True on success.
|
||||
type DeleteMessageReactionParams struct {
|
||||
// Unique identifier for the target chat or username of the target supergroup (in the format @username)
|
||||
// Unique identifier for the target chat or username of the target supergroup in the format @username
|
||||
ChatID ChatID `json:"chat_id"`
|
||||
// Identifier of the target message
|
||||
MessageID int64 `json:"message_id"`
|
||||
@@ -4348,7 +4348,7 @@ func DeleteMessageReaction(ctx context.Context, b *client.Bot, p *DeleteMessageR
|
||||
//
|
||||
// Use this method to remove up to 10000 recent reactions in a group or a supergroup chat added by a given user or chat. The bot must have the 'can_delete_messages' administrator right in the chat. Returns True on success.
|
||||
type DeleteAllMessageReactionsParams struct {
|
||||
// Unique identifier for the target chat or username of the target supergroup (in the format @username)
|
||||
// Unique identifier for the target chat or username of the target supergroup in the format @username
|
||||
ChatID ChatID `json:"chat_id"`
|
||||
// Identifier of the user whose reactions will be removed, if the reactions were added by a user
|
||||
UserID *int64 `json:"user_id,omitempty"`
|
||||
@@ -4391,7 +4391,7 @@ type SendStickerParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
|
||||
@@ -4769,7 +4769,7 @@ func SetStickerSetThumbnail(ctx context.Context, b *client.Bot, p *SetStickerSet
|
||||
type SetCustomEmojiStickerSetThumbnailParams struct {
|
||||
// Sticker set name
|
||||
Name string `json:"name"`
|
||||
// Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail.
|
||||
// Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail
|
||||
CustomEmojiID string `json:"custom_emoji_id,omitempty"`
|
||||
}
|
||||
|
||||
@@ -4846,7 +4846,7 @@ type SendInvoiceParams struct {
|
||||
MaxTipAmount *int64 `json:"max_tip_amount,omitempty"`
|
||||
// A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
|
||||
SuggestedTipAmounts []int64 `json:"suggested_tip_amounts,omitempty"`
|
||||
// Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter
|
||||
// Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter.
|
||||
StartParameter string `json:"start_parameter,omitempty"`
|
||||
// JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
|
||||
ProviderData string `json:"provider_data,omitempty"`
|
||||
@@ -5118,15 +5118,15 @@ type SetGameScoreParams struct {
|
||||
UserID int64 `json:"user_id"`
|
||||
// New score, must be non-negative
|
||||
Score int64 `json:"score"`
|
||||
// Pass True if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
|
||||
// Pass True if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters.
|
||||
Force *bool `json:"force,omitempty"`
|
||||
// Pass True if the game message should not be automatically edited to include the current scoreboard
|
||||
DisableEditMessage *bool `json:"disable_edit_message,omitempty"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat.
|
||||
ChatID *int64 `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the sent message
|
||||
// Required if inline_message_id is not specified. Identifier of the sent message.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
}
|
||||
|
||||
@@ -5144,11 +5144,11 @@ func SetGameScore(ctx context.Context, b *client.Bot, p *SetGameScoreParams) (*M
|
||||
type GetGameHighScoresParams struct {
|
||||
// Target user id
|
||||
UserID int64 `json:"user_id"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat.
|
||||
ChatID *int64 `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the sent message
|
||||
// Required if inline_message_id is not specified. Identifier of the sent message.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
+63
-63
@@ -48,13 +48,13 @@ type Update struct {
|
||||
ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"`
|
||||
// Optional. New incoming callback query
|
||||
CallbackQuery *CallbackQuery `json:"callback_query,omitempty"`
|
||||
// Optional. New incoming shipping query. Only for invoices with flexible price
|
||||
// Optional. New incoming shipping query. Only for invoices with flexible price.
|
||||
ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"`
|
||||
// Optional. New incoming pre-checkout query. Contains full information about checkout
|
||||
// Optional. New incoming pre-checkout query. Contains full information about checkout.
|
||||
PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"`
|
||||
// Optional. A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat
|
||||
PurchasedPaidMedia *PaidMediaPurchased `json:"purchased_paid_media,omitempty"`
|
||||
// Optional. New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot
|
||||
// Optional. New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot.
|
||||
Poll *Poll `json:"poll,omitempty"`
|
||||
// Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
|
||||
PollAnswer *PollAnswer `json:"poll_answer,omitempty"`
|
||||
@@ -90,7 +90,7 @@ type WebhookInfo struct {
|
||||
LastSynchronizationErrorDate *int64 `json:"last_synchronization_error_date,omitempty"`
|
||||
// Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
|
||||
MaxConnections *int64 `json:"max_connections,omitempty"`
|
||||
// Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member
|
||||
// Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member, message_reaction, and message_reaction_count.
|
||||
AllowedUpdates []UpdateType `json:"allowed_updates,omitempty"`
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ type ChatFullInfo struct {
|
||||
FirstProfileAudio *Audio `json:"first_profile_audio,omitempty"`
|
||||
// Optional. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews
|
||||
UniqueGiftColors *UniqueGiftColors `json:"unique_gift_colors,omitempty"`
|
||||
// Optional. The number of Telegram Stars a general user have to pay to send a message to the chat
|
||||
// Optional. The number of Telegram Stars a general user has to pay to send a message to the chat
|
||||
PaidMessageStarCount *int64 `json:"paid_message_star_count,omitempty"`
|
||||
}
|
||||
|
||||
@@ -292,13 +292,13 @@ func (m *ChatFullInfo) UnmarshalJSON(data []byte) error {
|
||||
|
||||
// This object represents a message.
|
||||
type Message struct {
|
||||
// Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
|
||||
// Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent.
|
||||
MessageID int64 `json:"message_id"`
|
||||
// Optional. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only
|
||||
MessageThreadID *int64 `json:"message_thread_id,omitempty"`
|
||||
// Optional. Information about the direct messages chat topic that contains the message
|
||||
DirectMessagesTopic *DirectMessagesTopic `json:"direct_messages_topic,omitempty"`
|
||||
// Optional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats
|
||||
// Optional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats.
|
||||
From *User `json:"from,omitempty"`
|
||||
// Optional. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.
|
||||
SenderChat *Chat `json:"sender_chat,omitempty"`
|
||||
@@ -364,13 +364,13 @@ type Message struct {
|
||||
SuggestedPostInfo *SuggestedPostInfo `json:"suggested_post_info,omitempty"`
|
||||
// Optional. Unique identifier of the message effect added to the message
|
||||
EffectID string `json:"effect_id,omitempty"`
|
||||
// Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
|
||||
// Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set.
|
||||
Animation *Animation `json:"animation,omitempty"`
|
||||
// Optional. Message is an audio file, information about the file
|
||||
Audio *Audio `json:"audio,omitempty"`
|
||||
// Optional. Message is a general file, information about the file
|
||||
Document *Document `json:"document,omitempty"`
|
||||
// Optional. Message is a live photo, information about the live photo. For backward compatibility, when this field is set, the photo field will also be set
|
||||
// Optional. Message is a live photo, information about the live photo. For backward compatibility, when this field is set, the photo field will also be set.
|
||||
LivePhoto *LivePhoto `json:"live_photo,omitempty"`
|
||||
// Optional. Message contains paid media; information about the paid media
|
||||
PaidMedia *PaidMediaInfo `json:"paid_media,omitempty"`
|
||||
@@ -404,7 +404,7 @@ type Message struct {
|
||||
Game *Game `json:"game,omitempty"`
|
||||
// Optional. Message is a native poll, information about the poll
|
||||
Poll *Poll `json:"poll,omitempty"`
|
||||
// Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
|
||||
// Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set.
|
||||
Venue *Venue `json:"venue,omitempty"`
|
||||
// Optional. Message is a shared location, information about the location
|
||||
Location *Location `json:"location,omitempty"`
|
||||
@@ -558,7 +558,7 @@ func (m *Message) UnmarshalJSON(data []byte) error {
|
||||
|
||||
// This object represents a unique message identifier.
|
||||
type MessageId struct {
|
||||
// Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
|
||||
// Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent.
|
||||
MessageID int64 `json:"message_id"`
|
||||
}
|
||||
|
||||
@@ -613,7 +613,7 @@ func UnmarshalMaybeInaccessibleMessage(data []byte) (MaybeInaccessibleMessage, e
|
||||
|
||||
// This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
|
||||
type MessageEntity struct {
|
||||
// Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time)
|
||||
// Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time).
|
||||
Type MessageEntityType `json:"type"`
|
||||
// Offset in UTF-16 code units to the start of the entity
|
||||
Offset int64 `json:"offset"`
|
||||
@@ -625,7 +625,7 @@ type MessageEntity struct {
|
||||
User *User `json:"user,omitempty"`
|
||||
// Optional. For “pre” only, the programming language of the entity text
|
||||
Language string `json:"language,omitempty"`
|
||||
// Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker
|
||||
// Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker.
|
||||
CustomEmojiID string `json:"custom_emoji_id,omitempty"`
|
||||
// Optional. For “date_time” only, the Unix time associated with the entity
|
||||
UnixTime *int64 `json:"unix_time,omitempty"`
|
||||
@@ -1411,9 +1411,9 @@ type PollOption struct {
|
||||
type InputPollOption struct {
|
||||
// Option text, 1-100 characters
|
||||
Text string `json:"text"`
|
||||
// Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed
|
||||
// Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed.
|
||||
TextParseMode ParseMode `json:"text_parse_mode,omitempty"`
|
||||
// Optional. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode
|
||||
// Optional. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode.
|
||||
TextEntities []MessageEntity `json:"text_entities,omitempty"`
|
||||
// Optional. Media added to the poll option
|
||||
Media InputPollOptionMedia `json:"media,omitempty"`
|
||||
@@ -1457,7 +1457,7 @@ type Poll struct {
|
||||
AllowsRevoting bool `json:"allows_revoting"`
|
||||
// True if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours
|
||||
MembersOnly bool `json:"members_only"`
|
||||
// Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll. If omitted, then users from any country can participate in the poll.
|
||||
// Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll. The country code “FT” is used for users with anonymous numbers. If omitted, then users from any country can participate in the poll.
|
||||
CountryCodes []string `json:"country_codes,omitempty"`
|
||||
// Optional. Array of 0-based identifiers of the correct answer options. Available only for polls in quiz mode which are closed or were sent (not forwarded) by the bot or to the private chat with the bot.
|
||||
CorrectOptionIds []int64 `json:"correct_option_ids,omitempty"`
|
||||
@@ -1573,7 +1573,7 @@ type Location struct {
|
||||
|
||||
// This object represents a venue.
|
||||
type Venue struct {
|
||||
// Venue location. Can't be a live location
|
||||
// Venue location. Can't be a live location.
|
||||
Location Location `json:"location"`
|
||||
// Name of the venue
|
||||
Title string `json:"title"`
|
||||
@@ -1965,7 +1965,7 @@ type BackgroundTypePattern struct {
|
||||
Fill BackgroundFill `json:"fill"`
|
||||
// Intensity of the pattern when it is shown above the filled background; 0-100
|
||||
Intensity int64 `json:"intensity"`
|
||||
// Optional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only
|
||||
// Optional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only.
|
||||
IsInverted *bool `json:"is_inverted,omitempty"`
|
||||
// Optional. True, if the background moves slightly when the device is tilted
|
||||
IsMoving *bool `json:"is_moving,omitempty"`
|
||||
@@ -2119,7 +2119,7 @@ type SharedUser struct {
|
||||
type UsersShared struct {
|
||||
// Identifier of the request
|
||||
RequestID int64 `json:"request_id"`
|
||||
// Information about users shared with the bot.
|
||||
// Information about users shared with the bot
|
||||
Users []SharedUser `json:"users"`
|
||||
}
|
||||
|
||||
@@ -2129,9 +2129,9 @@ type ChatShared struct {
|
||||
RequestID int64 `json:"request_id"`
|
||||
// Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.
|
||||
ChatID int64 `json:"chat_id"`
|
||||
// Optional. Title of the chat, if the title was requested by the bot.
|
||||
// Optional. Title of the chat, if the title was requested by the bot
|
||||
Title string `json:"title,omitempty"`
|
||||
// Optional. Username of the chat, if the username was requested by the bot and available.
|
||||
// Optional. Username of the chat, if the username was requested by the bot and available
|
||||
Username string `json:"username,omitempty"`
|
||||
// Optional. Available sizes of the chat photo, if the photo was requested by the bot
|
||||
Photo []PhotoSize `json:"photo,omitempty"`
|
||||
@@ -2213,7 +2213,7 @@ type SuggestedPostDeclined struct {
|
||||
type SuggestedPostPaid struct {
|
||||
// Optional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
|
||||
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"`
|
||||
// Currency in which the payment was made. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins
|
||||
// Currency in which the payment was made. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins.
|
||||
Currency SuggestedPostPaidCurrency `json:"currency"`
|
||||
// Optional. The amount of the currency that was received by the channel in nanotoncoins; for payments in toncoins only
|
||||
Amount *int64 `json:"amount,omitempty"`
|
||||
@@ -2301,7 +2301,7 @@ type GiveawayCompleted struct {
|
||||
type LinkPreviewOptions struct {
|
||||
// Optional. True, if the link preview is disabled
|
||||
IsDisabled *bool `json:"is_disabled,omitempty"`
|
||||
// Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used
|
||||
// Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used.
|
||||
URL string `json:"url,omitempty"`
|
||||
// Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
|
||||
PreferSmallMedia *bool `json:"prefer_small_media,omitempty"`
|
||||
@@ -2313,7 +2313,7 @@ type LinkPreviewOptions struct {
|
||||
|
||||
// Describes the price of a suggested post.
|
||||
type SuggestedPostPrice struct {
|
||||
// Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins
|
||||
// Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins.
|
||||
Currency SuggestedPostPaidCurrency `json:"currency"`
|
||||
// The amount of the currency that will be paid for the post in the smallest units of the currency, i.e. Telegram Stars or nanotoncoins. Currently, price in Telegram Stars must be between 5 and 100000, and price in nanotoncoins must be between 10000000 and 10000000000000.
|
||||
Amount int64 `json:"amount"`
|
||||
@@ -2341,7 +2341,7 @@ type SuggestedPostParameters struct {
|
||||
type DirectMessagesTopic struct {
|
||||
// Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
|
||||
TopicID int64 `json:"topic_id"`
|
||||
// Optional. Information about the user that created the topic. Currently, it is always present
|
||||
// Optional. Information about the user that created the topic. Currently, it is always present.
|
||||
User *User `json:"user,omitempty"`
|
||||
}
|
||||
|
||||
@@ -2398,7 +2398,7 @@ type ReplyKeyboardMarkup struct {
|
||||
|
||||
// This object represents one button of the reply keyboard. At most one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. For simple text buttons, String can be used instead of this object to specify the button text.
|
||||
type KeyboardButton struct {
|
||||
// Text of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed
|
||||
// Text of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed.
|
||||
Text string `json:"text"`
|
||||
// Optional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.
|
||||
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
|
||||
@@ -2422,7 +2422,7 @@ type KeyboardButton struct {
|
||||
|
||||
// This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users »
|
||||
type KeyboardButtonRequestUsers struct {
|
||||
// Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message
|
||||
// Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message.
|
||||
RequestID int64 `json:"request_id"`
|
||||
// Optional. Pass True to request bots, pass False to request regular users. If not specified, no additional restrictions are applied.
|
||||
UserIsBot *bool `json:"user_is_bot,omitempty"`
|
||||
@@ -2440,9 +2440,9 @@ type KeyboardButtonRequestUsers struct {
|
||||
|
||||
// This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. More about requesting chats ».
|
||||
type KeyboardButtonRequestChat struct {
|
||||
// Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message
|
||||
// Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message.
|
||||
RequestID int64 `json:"request_id"`
|
||||
// Pass True to request a channel chat, pass False to request a group or a supergroup chat.
|
||||
// Pass True to request a channel chat, pass False to request a group or a supergroup chat
|
||||
ChatIsChannel bool `json:"chat_is_channel"`
|
||||
// Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.
|
||||
ChatIsForum *bool `json:"chat_is_forum,omitempty"`
|
||||
@@ -2466,7 +2466,7 @@ type KeyboardButtonRequestChat struct {
|
||||
|
||||
// This object defines the parameters for the creation of a managed bot. Information about the created bot will be shared with the bot using the update managed_bot and a Message with the field managed_bot_created.
|
||||
type KeyboardButtonRequestManagedBot struct {
|
||||
// Signed 32-bit identifier of the request. Must be unique within the message
|
||||
// Signed 32-bit identifier of the request. Must be unique within the message.
|
||||
RequestID int64 `json:"request_id"`
|
||||
// Optional. Suggested name for the bot
|
||||
SuggestedName string `json:"suggested_name,omitempty"`
|
||||
@@ -2516,7 +2516,7 @@ type InlineKeyboardButton struct {
|
||||
SwitchInlineQueryCurrentChat string `json:"switch_inline_query_current_chat,omitempty"`
|
||||
// Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a business account.
|
||||
SwitchInlineQueryChosenChat *SwitchInlineQueryChosenChat `json:"switch_inline_query_chosen_chat,omitempty"`
|
||||
// Optional. Description of the button that copies the specified text to the clipboard.
|
||||
// Optional. Description of the button that copies the specified text to the clipboard
|
||||
CopyText *CopyTextButton `json:"copy_text,omitempty"`
|
||||
// Optional. Description of the game that will be launched when the user presses the button.NOTE: This type of button must always be the first button in the first row.
|
||||
CallbackGame *CallbackGame `json:"callback_game,omitempty"`
|
||||
@@ -2530,17 +2530,17 @@ type InlineKeyboardButton struct {
|
||||
type LoginUrl struct {
|
||||
// An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
|
||||
URL string `json:"url"`
|
||||
// Optional. New text of the button in forwarded messages.
|
||||
// Optional. New text of the button in forwarded messages
|
||||
ForwardText string `json:"forward_text,omitempty"`
|
||||
// Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.
|
||||
BotUsername string `json:"bot_username,omitempty"`
|
||||
// Optional. Pass True to request the permission for your bot to send messages to the user.
|
||||
// Optional. Pass True to request the permission for your bot to send messages to the user
|
||||
RequestWriteAccess *bool `json:"request_write_access,omitempty"`
|
||||
}
|
||||
|
||||
// This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.
|
||||
type SwitchInlineQueryChosenChat struct {
|
||||
// Optional. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted
|
||||
// Optional. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted.
|
||||
Query string `json:"query,omitempty"`
|
||||
// Optional. True, if private chats with users can be chosen
|
||||
AllowUserChats *bool `json:"allow_user_chats,omitempty"`
|
||||
@@ -2567,7 +2567,7 @@ type CallbackQuery struct {
|
||||
From User `json:"from"`
|
||||
// Optional. Message sent by the bot with the callback button that originated the query
|
||||
Message MaybeInaccessibleMessage `json:"message,omitempty"`
|
||||
// Optional. Identifier of the message sent via the bot in inline mode, that originated the query.
|
||||
// Optional. Identifier of the message sent via the bot in inline mode, that originated the query
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
// Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
|
||||
ChatInstance string `json:"chat_instance"`
|
||||
@@ -2701,7 +2701,7 @@ type ChatMemberUpdated struct {
|
||||
OldChatMember ChatMember `json:"old_chat_member"`
|
||||
// New information about the chat member
|
||||
NewChatMember ChatMember `json:"new_chat_member"`
|
||||
// Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
|
||||
// Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only
|
||||
InviteLink *ChatInviteLink `json:"invite_link,omitempty"`
|
||||
// Optional. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator
|
||||
ViaJoinRequest *bool `json:"via_join_request,omitempty"`
|
||||
@@ -2965,7 +2965,7 @@ type ChatMemberRestricted struct {
|
||||
CanPinMessages bool `json:"can_pin_messages"`
|
||||
// True, if the user is allowed to create forum topics
|
||||
CanManageTopics bool `json:"can_manage_topics"`
|
||||
// Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever
|
||||
// Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever.
|
||||
UntilDate int64 `json:"until_date"`
|
||||
}
|
||||
|
||||
@@ -3015,7 +3015,7 @@ type ChatMemberBanned struct {
|
||||
Status ChatMemberStatus `json:"status"`
|
||||
// Information about the user
|
||||
User User `json:"user"`
|
||||
// Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever
|
||||
// Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever.
|
||||
UntilDate int64 `json:"until_date"`
|
||||
}
|
||||
|
||||
@@ -3045,7 +3045,7 @@ type ChatJoinRequest struct {
|
||||
UserChatID int64 `json:"user_chat_id"`
|
||||
// Date the request was sent in Unix time
|
||||
Date int64 `json:"date"`
|
||||
// Optional. Bio of the user.
|
||||
// Optional. Bio of the user
|
||||
Bio string `json:"bio,omitempty"`
|
||||
// Optional. Chat invite link that was used by the user to send the join request
|
||||
InviteLink *ChatInviteLink `json:"invite_link,omitempty"`
|
||||
@@ -3077,13 +3077,13 @@ type ChatPermissions struct {
|
||||
CanReactToMessages *bool `json:"can_react_to_messages,omitempty"`
|
||||
// Optional. True, if the user is allowed to edit their own tag. If omitted, defaults to the value of can_pin_messages.
|
||||
CanEditTag *bool `json:"can_edit_tag,omitempty"`
|
||||
// Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
|
||||
// Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups.
|
||||
CanChangeInfo *bool `json:"can_change_info,omitempty"`
|
||||
// Optional. True, if the user is allowed to invite new users to the chat
|
||||
CanInviteUsers *bool `json:"can_invite_users,omitempty"`
|
||||
// Optional. True, if the user is allowed to pin messages. Ignored in public supergroups
|
||||
// Optional. True, if the user is allowed to pin messages. Ignored in public supergroups.
|
||||
CanPinMessages *bool `json:"can_pin_messages,omitempty"`
|
||||
// Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages
|
||||
// Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages.
|
||||
CanManageTopics *bool `json:"can_manage_topics,omitempty"`
|
||||
}
|
||||
|
||||
@@ -3471,7 +3471,7 @@ func UnmarshalReactionType(data []byte) (ReactionType, error) {
|
||||
type ReactionTypeEmoji struct {
|
||||
// Type of the reaction, always “emoji”
|
||||
Type ReactionTypeKind `json:"type"`
|
||||
// Reaction emoji. Currently, it can be one of "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
|
||||
// Reaction emoji. Currently, it can be one of "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "".
|
||||
Emoji ReactionEmoji `json:"emoji"`
|
||||
}
|
||||
|
||||
@@ -3775,7 +3775,7 @@ type UniqueGift struct {
|
||||
GiftID string `json:"gift_id"`
|
||||
// Human-readable name of the regular gift from which this unique gift was upgraded
|
||||
BaseName string `json:"base_name"`
|
||||
// Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas
|
||||
// Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas.
|
||||
Name string `json:"name"`
|
||||
// Unique number of the upgraded gift among gifts upgraded from the same regular gift
|
||||
Number int64 `json:"number"`
|
||||
@@ -3817,7 +3817,7 @@ type GiftInfo struct {
|
||||
Entities []MessageEntity `json:"entities,omitempty"`
|
||||
// Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
|
||||
IsPrivate *bool `json:"is_private,omitempty"`
|
||||
// Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift
|
||||
// Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift.
|
||||
UniqueGiftNumber *int64 `json:"unique_gift_number,omitempty"`
|
||||
}
|
||||
|
||||
@@ -3825,7 +3825,7 @@ type GiftInfo struct {
|
||||
type UniqueGiftInfo struct {
|
||||
// Information about the gift
|
||||
Gift UniqueGift `json:"gift"`
|
||||
// Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, “resale” for gifts bought from other users, “gifted_upgrade” for upgrades purchased after the gift was sent, or “offer” for gifts bought or sold through gift purchase offers
|
||||
// Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, “resale” for gifts bought from other users, “gifted_upgrade” for upgrades purchased after the gift was sent, or “offer” for gifts bought or sold through gift purchase offers.
|
||||
Origin UniqueGiftInfoOrigin `json:"origin"`
|
||||
// Optional. For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins.
|
||||
LastResaleCurrency SuggestedPostPaidCurrency `json:"last_resale_currency,omitempty"`
|
||||
@@ -3835,7 +3835,7 @@ type UniqueGiftInfo struct {
|
||||
OwnedGiftID string `json:"owned_gift_id,omitempty"`
|
||||
// Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift
|
||||
TransferStarCount *int64 `json:"transfer_star_count,omitempty"`
|
||||
// Optional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now
|
||||
// Optional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now.
|
||||
NextTransferDate *int64 `json:"next_transfer_date,omitempty"`
|
||||
}
|
||||
|
||||
@@ -3907,7 +3907,7 @@ type OwnedGiftRegular struct {
|
||||
PrepaidUpgradeStarCount *int64 `json:"prepaid_upgrade_star_count,omitempty"`
|
||||
// Optional. True, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only
|
||||
IsUpgradeSeparate *bool `json:"is_upgrade_separate,omitempty"`
|
||||
// Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift
|
||||
// Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift.
|
||||
UniqueGiftNumber *int64 `json:"unique_gift_number,omitempty"`
|
||||
}
|
||||
|
||||
@@ -3945,7 +3945,7 @@ type OwnedGiftUnique struct {
|
||||
CanBeTransferred *bool `json:"can_be_transferred,omitempty"`
|
||||
// Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift
|
||||
TransferStarCount *int64 `json:"transfer_star_count,omitempty"`
|
||||
// Optional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now
|
||||
// Optional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now.
|
||||
NextTransferDate *int64 `json:"next_transfer_date,omitempty"`
|
||||
}
|
||||
|
||||
@@ -3971,7 +3971,7 @@ type OwnedGifts struct {
|
||||
TotalCount int64 `json:"total_count"`
|
||||
// The list of gifts
|
||||
Gifts []OwnedGift `json:"gifts"`
|
||||
// Optional. Offset for the next request. If empty, then there are no more results
|
||||
// Optional. Offset for the next request. If empty, then there are no more results.
|
||||
NextOffset string `json:"next_offset,omitempty"`
|
||||
}
|
||||
|
||||
@@ -4041,7 +4041,7 @@ type StarAmount struct {
|
||||
type BotCommand struct {
|
||||
// Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
|
||||
Command string `json:"command"`
|
||||
// Description of the command; 1-256 characters.
|
||||
// Description of the command; 1-256 characters
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
@@ -4668,7 +4668,7 @@ type SentGuestMessage struct {
|
||||
type PreparedInlineMessage struct {
|
||||
// Unique identifier of the prepared message
|
||||
ID string `json:"id"`
|
||||
// Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used
|
||||
// Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used.
|
||||
ExpirationDate int64 `json:"expiration_date"`
|
||||
}
|
||||
|
||||
@@ -5354,7 +5354,7 @@ type InlineQuery struct {
|
||||
Query string `json:"query"`
|
||||
// Offset of the results to be returned, can be controlled by the bot
|
||||
Offset string `json:"offset"`
|
||||
// Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat
|
||||
// Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat.
|
||||
ChatType InlineQueryChatType `json:"chat_type,omitempty"`
|
||||
// Optional. Sender location, only for bots that request user location
|
||||
Location *Location `json:"location,omitempty"`
|
||||
@@ -5503,7 +5503,7 @@ type InlineQueryResultPhoto struct {
|
||||
Type InlineQueryResultType `json:"type"`
|
||||
// Unique identifier for this result, 1-64 bytes
|
||||
ID string `json:"id"`
|
||||
// A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB
|
||||
// A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB.
|
||||
PhotoURL string `json:"photo_url"`
|
||||
// URL of the thumbnail for the photo
|
||||
ThumbnailURL string `json:"thumbnail_url"`
|
||||
@@ -5561,7 +5561,7 @@ type InlineQueryResultGif struct {
|
||||
GifDuration *int64 `json:"gif_duration,omitempty"`
|
||||
// URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
|
||||
ThumbnailURL string `json:"thumbnail_url"`
|
||||
// Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
|
||||
// Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”.
|
||||
ThumbnailMimeType InlineQueryResultGifThumbnailMimeType `json:"thumbnail_mime_type,omitempty"`
|
||||
// Optional. Title for the result
|
||||
Title string `json:"title,omitempty"`
|
||||
@@ -5611,7 +5611,7 @@ type InlineQueryResultMpeg4Gif struct {
|
||||
Mpeg4Duration *int64 `json:"mpeg4_duration,omitempty"`
|
||||
// URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
|
||||
ThumbnailURL string `json:"thumbnail_url"`
|
||||
// Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
|
||||
// Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”.
|
||||
ThumbnailMimeType InlineQueryResultGifThumbnailMimeType `json:"thumbnail_mime_type,omitempty"`
|
||||
// Optional. Title for the result
|
||||
Title string `json:"title,omitempty"`
|
||||
@@ -5842,7 +5842,7 @@ type InlineQueryResultLocation struct {
|
||||
Title string `json:"title"`
|
||||
// Optional. The radius of uncertainty for the location, measured in meters; 0-1500
|
||||
HorizontalAccuracy *float64 `json:"horizontal_accuracy,omitempty"`
|
||||
// Optional. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
|
||||
// Optional. Period in seconds during which the location can be updated, must be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely
|
||||
LivePeriod *int64 `json:"live_period,omitempty"`
|
||||
// Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
|
||||
Heading *int64 `json:"heading,omitempty"`
|
||||
@@ -6350,7 +6350,7 @@ type InputLocationMessageContent struct {
|
||||
Longitude float64 `json:"longitude"`
|
||||
// Optional. The radius of uncertainty for the location, measured in meters; 0-1500
|
||||
HorizontalAccuracy *float64 `json:"horizontal_accuracy,omitempty"`
|
||||
// Optional. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
|
||||
// Optional. Period in seconds during which the location can be updated, must be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely
|
||||
LivePeriod *int64 `json:"live_period,omitempty"`
|
||||
// Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
|
||||
Heading *int64 `json:"heading,omitempty"`
|
||||
@@ -6535,7 +6535,7 @@ type SuccessfulPayment struct {
|
||||
|
||||
// This object contains basic information about a refunded payment.
|
||||
type RefundedPayment struct {
|
||||
// Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. Currently, always “XTR”
|
||||
// Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. Currently, always “XTR”.
|
||||
Currency RefundedPaymentCurrency `json:"currency"`
|
||||
// Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
|
||||
TotalAmount int64 `json:"total_amount"`
|
||||
@@ -7027,9 +7027,9 @@ type StarTransaction struct {
|
||||
NanostarAmount *int64 `json:"nanostar_amount,omitempty"`
|
||||
// Date the transaction was created in Unix time
|
||||
Date int64 `json:"date"`
|
||||
// Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions
|
||||
// Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions.
|
||||
Source TransactionPartner `json:"source,omitempty"`
|
||||
// Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions
|
||||
// Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions.
|
||||
Receiver TransactionPartner `json:"receiver,omitempty"`
|
||||
}
|
||||
|
||||
@@ -7429,13 +7429,13 @@ type Game struct {
|
||||
Title string `json:"title"`
|
||||
// Description of the game
|
||||
Description string `json:"description"`
|
||||
// Photo that will be displayed in the game message in chats.
|
||||
// Photo that will be displayed in the game message in chats
|
||||
Photo []PhotoSize `json:"photo"`
|
||||
// Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
|
||||
Text string `json:"text,omitempty"`
|
||||
// Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
|
||||
TextEntities []MessageEntity `json:"text_entities,omitempty"`
|
||||
// Optional. Animation that will be displayed in the game message in chats. Upload via BotFather
|
||||
// Optional. Animation that will be displayed in the game message in chats. Upload via BotFather.
|
||||
Animation *Animation `json:"animation,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
+141
-17
@@ -23,9 +23,17 @@ var (
|
||||
// return slices that alias the buffer and therefore cannot use the
|
||||
// pool without an extra copy that would defeat the point.
|
||||
respBufPool = sync.Pool{New: func() any { return new(bytes.Buffer) }}
|
||||
|
||||
// reqBufPool reuses *bytes.Buffer for request body marshalling on the
|
||||
// JSON path. Only used when the configured Codec satisfies BodyEncoder
|
||||
// so we can stream-encode into the buffer instead of allocating an
|
||||
// intermediate []byte. The buffer is safe to return to the pool once
|
||||
// http.Client.Do (or RetryDoer, which io.ReadAlls the body up front)
|
||||
// has consumed it.
|
||||
reqBufPool = sync.Pool{New: func() any { return new(bytes.Buffer) }}
|
||||
)
|
||||
|
||||
// maxPooledBufCap caps the buffer size returned to respBufPool. Buffers
|
||||
// maxPooledBufCap caps the buffer size returned to either pool. Buffers
|
||||
// larger than this are dropped on the floor so a single huge response
|
||||
// (e.g. a large getFile metadata payload) doesn't bloat the pool for the
|
||||
// rest of the process lifetime.
|
||||
@@ -38,6 +46,13 @@ func putRespBuf(buf *bytes.Buffer) {
|
||||
respBufPool.Put(buf)
|
||||
}
|
||||
|
||||
func putReqBuf(buf *bytes.Buffer) {
|
||||
if buf.Cap() > maxPooledBufCap {
|
||||
return
|
||||
}
|
||||
reqBufPool.Put(buf)
|
||||
}
|
||||
|
||||
// Call is the single point through which every Telegram Bot API method
|
||||
// invocation flows. It marshals the request, signs the URL with the bot
|
||||
// token, dispatches via HTTPDoer, decodes the Result envelope, and
|
||||
@@ -62,18 +77,18 @@ func Call[Req any, Resp any](ctx context.Context, b *Bot, method string, req Req
|
||||
}
|
||||
}
|
||||
|
||||
body, err := encodeJSONBody(b.codec, req)
|
||||
body, pooledReqBuf, err := encodeJSONBody(b.codec, req)
|
||||
if err != nil {
|
||||
return zero, err
|
||||
}
|
||||
if pooledReqBuf != nil {
|
||||
defer putReqBuf(pooledReqBuf)
|
||||
}
|
||||
|
||||
url := b.base + "/bot" + b.token + "/" + method
|
||||
httpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, url, body)
|
||||
httpReq, err := b.buildRequest(ctx, method, body)
|
||||
if err != nil {
|
||||
return zero, &NetworkError{Err: err}
|
||||
}
|
||||
httpReq.Header["Content-Type"] = headerJSONValue
|
||||
httpReq.Header["Accept"] = headerJSONValue
|
||||
|
||||
resp, err := b.http.Do(httpReq)
|
||||
if err != nil {
|
||||
@@ -111,18 +126,18 @@ func CallRaw[Req any](ctx context.Context, b *Bot, method string, req Req) (json
|
||||
}
|
||||
}
|
||||
|
||||
body, err := encodeJSONBody(b.codec, req)
|
||||
body, pooledReqBuf, err := encodeJSONBody(b.codec, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if pooledReqBuf != nil {
|
||||
defer putReqBuf(pooledReqBuf)
|
||||
}
|
||||
|
||||
url := b.base + "/bot" + b.token + "/" + method
|
||||
httpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, url, body)
|
||||
httpReq, err := b.buildRequest(ctx, method, body)
|
||||
if err != nil {
|
||||
return nil, &NetworkError{Err: err}
|
||||
}
|
||||
httpReq.Header["Content-Type"] = headerJSONValue
|
||||
httpReq.Header["Accept"] = headerJSONValue
|
||||
|
||||
resp, err := b.http.Do(httpReq)
|
||||
if err != nil {
|
||||
@@ -154,17 +169,126 @@ func decodeResultRaw(codec Codec, raw []byte) (json.RawMessage, error) {
|
||||
return env.Result, nil
|
||||
}
|
||||
|
||||
// encodeJSONBody marshals req to a JSON body. A nil interface or nil
|
||||
// pointer req yields "{}" so Telegram receives a valid empty object.
|
||||
func encodeJSONBody(codec Codec, req any) (io.Reader, error) {
|
||||
// buildRequest constructs the *http.Request for an API call. When the bot
|
||||
// has a cached parsed base URL (the common path), the request is built
|
||||
// manually so that net/url.Parse and net/http.NewRequestWithContext's
|
||||
// internal book-keeping are skipped — saving allocations on every call.
|
||||
//
|
||||
// ContentLength and GetBody are populated from the body's concrete type
|
||||
// in bodyToReadCloser so RetryDoer can replay the body across attempts.
|
||||
func (b *Bot) buildRequest(ctx context.Context, method string, body io.Reader) (*http.Request, error) {
|
||||
if b.baseURL == nil {
|
||||
// Slow path: WithBaseURL configured an unparsable URL (or New ran
|
||||
// before pre-parse for some reason). Fall back to the stdlib
|
||||
// constructor so we still produce a valid request.
|
||||
url := b.base + b.pathPrefix + method
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.Header["Content-Type"] = headerJSONValue
|
||||
req.Header["Accept"] = headerJSONValue
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// Fast path: clone the cached *url.URL by value, set the per-method
|
||||
// path. Constructing &http.Request{} directly avoids the Header,
|
||||
// URL-parse, and ContentLength bookkeeping that NewRequestWithContext
|
||||
// runs unconditionally.
|
||||
u := *b.baseURL
|
||||
u.Path = b.pathPrefix + method
|
||||
u.RawPath = ""
|
||||
|
||||
rc, contentLength, getBody := bodyToReadCloser(body)
|
||||
req := &http.Request{
|
||||
Method: http.MethodPost,
|
||||
URL: &u,
|
||||
Proto: "HTTP/1.1",
|
||||
ProtoMajor: 1,
|
||||
ProtoMinor: 1,
|
||||
Header: http.Header{"Content-Type": headerJSONValue, "Accept": headerJSONValue},
|
||||
Body: rc,
|
||||
GetBody: getBody,
|
||||
ContentLength: contentLength,
|
||||
Host: u.Host,
|
||||
}
|
||||
return req.WithContext(ctx), nil
|
||||
}
|
||||
|
||||
// bufferReadCloser exposes a *bytes.Buffer as io.ReadCloser without going
|
||||
// through io.NopCloser. Keeping the concrete *bytes.Buffer accessible lets
|
||||
// alternative HTTPDoers (e.g. FastHTTPDoer) type-assert and pass the
|
||||
// underlying bytes through to their native body-set APIs without copying.
|
||||
type bufferReadCloser struct {
|
||||
*bytes.Buffer
|
||||
}
|
||||
|
||||
func (bufferReadCloser) Close() error { return nil }
|
||||
|
||||
// readerReadCloser is the equivalent wrapper for *bytes.Reader (used by
|
||||
// the Marshal fallback path when the codec doesn't implement BodyEncoder).
|
||||
type readerReadCloser struct {
|
||||
*bytes.Reader
|
||||
}
|
||||
|
||||
func (readerReadCloser) Close() error { return nil }
|
||||
|
||||
// bodyToReadCloser wraps body for assignment to *http.Request.Body. The
|
||||
// type switch covers the body shapes encodeJSONBody returns: a pooled
|
||||
// *bytes.Buffer (BodyEncoder path or {} fast path) or a *bytes.Reader
|
||||
// (Marshal fallback for codecs that don't implement BodyEncoder). Both
|
||||
// cases populate ContentLength and GetBody so RetryDoer can replay the
|
||||
// body across retry attempts without buffering it again.
|
||||
func bodyToReadCloser(body io.Reader) (io.ReadCloser, int64, func() (io.ReadCloser, error)) {
|
||||
switch v := body.(type) {
|
||||
case *bytes.Buffer:
|
||||
buf := v.Bytes()
|
||||
length := int64(len(buf))
|
||||
return bufferReadCloser{v}, length, func() (io.ReadCloser, error) {
|
||||
return readerReadCloser{bytes.NewReader(buf)}, nil
|
||||
}
|
||||
case *bytes.Reader:
|
||||
length := int64(v.Len())
|
||||
// Snapshot the reader's current data so GetBody returns a fresh one.
|
||||
snapshot := *v
|
||||
return readerReadCloser{v}, length, func() (io.ReadCloser, error) {
|
||||
s := snapshot
|
||||
return readerReadCloser{&s}, nil
|
||||
}
|
||||
default:
|
||||
// Unknown reader: no length, no replay. Should not happen with the
|
||||
// current encodeJSONBody body shapes but kept for forward safety.
|
||||
return io.NopCloser(body), -1, nil
|
||||
}
|
||||
}
|
||||
|
||||
// encodeJSONBody marshals req into a JSON body. It returns the body
|
||||
// reader plus, when the codec satisfies BodyEncoder, the pooled buffer
|
||||
// that backs it — callers MUST return that buffer to the pool via
|
||||
// putReqBuf once the request is done. The buffer return is exposed
|
||||
// directly (instead of a closure) so encodeJSONBody allocates nothing
|
||||
// on the pooled path beyond the codec's own internal allocations.
|
||||
//
|
||||
// The {} fast path used for nil/nil-pointer requests bypasses the pool
|
||||
// entirely; the 2-byte literal isn't worth the contention overhead.
|
||||
func encodeJSONBody(codec Codec, req any) (io.Reader, *bytes.Buffer, error) {
|
||||
if req == nil || isNilPointer(req) {
|
||||
return bytes.NewBufferString("{}"), nil
|
||||
return bytes.NewBufferString("{}"), nil, nil
|
||||
}
|
||||
if enc, ok := codec.(BodyEncoder); ok {
|
||||
buf := reqBufPool.Get().(*bytes.Buffer)
|
||||
buf.Reset()
|
||||
if err := enc.MarshalTo(buf, req); err != nil {
|
||||
putReqBuf(buf)
|
||||
return nil, nil, &ParseError{Err: err}
|
||||
}
|
||||
return buf, buf, nil
|
||||
}
|
||||
data, err := codec.Marshal(req)
|
||||
if err != nil {
|
||||
return nil, &ParseError{Err: err}
|
||||
return nil, nil, &ParseError{Err: err}
|
||||
}
|
||||
return bytes.NewReader(data), nil
|
||||
return bytes.NewReader(data), nil, nil
|
||||
}
|
||||
|
||||
// decodeResult unmarshals raw into Result[Resp] and translates non-OK
|
||||
|
||||
@@ -63,11 +63,14 @@ func BenchmarkEncodeJSONBody(b *testing.B) {
|
||||
req := &benchSendReq{ChatID: 42, Text: "hello, world"}
|
||||
b.ReportAllocs()
|
||||
for b.Loop() {
|
||||
r, err := encodeJSONBody(codec, req)
|
||||
r, pooled, err := encodeJSONBody(codec, req)
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
_ = r
|
||||
if pooled != nil {
|
||||
putReqBuf(pooled)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
)
|
||||
|
||||
const defaultBaseURL = "https://api.telegram.org"
|
||||
|
||||
// Bot is the Telegram Bot API client. Construct via New. All API methods
|
||||
@@ -10,6 +14,13 @@ type Bot struct {
|
||||
http HTTPDoer
|
||||
codec Codec
|
||||
logger Logger
|
||||
|
||||
// baseURL is the parsed form of base, lazily populated on first Call.
|
||||
// Caching it avoids running url.Parse on every API request.
|
||||
baseURL *url.URL
|
||||
// pathPrefix is "/bot<token>/" built once so per-call URL assembly
|
||||
// is a single string concatenation with the method name.
|
||||
pathPrefix string
|
||||
}
|
||||
|
||||
// Token returns the bot token. Exposed for advanced use cases (custom
|
||||
@@ -34,6 +45,7 @@ func (b *Bot) Logger() Logger { return b.logger }
|
||||
// NewDefaultHTTPDoer); the default codec wraps encoding/json; the default
|
||||
// logger discards records.
|
||||
func New(token string, opts ...Option) *Bot {
|
||||
fireTelemetryOnce()
|
||||
b := &Bot{
|
||||
token: token,
|
||||
base: defaultBaseURL,
|
||||
@@ -44,5 +56,13 @@ func New(token string, opts ...Option) *Bot {
|
||||
for _, o := range opts {
|
||||
o(b)
|
||||
}
|
||||
// Pre-compute URL pieces. Errors here are unlikely (defaultBaseURL is
|
||||
// well-formed; user-supplied bases via WithBaseURL are validated by
|
||||
// url.Parse below) but if parsing fails we leave baseURL nil and fall
|
||||
// back to the string-concat path on the next Call.
|
||||
if u, err := url.Parse(b.base); err == nil {
|
||||
b.baseURL = u
|
||||
}
|
||||
b.pathPrefix = "/bot" + b.token + "/"
|
||||
return b
|
||||
}
|
||||
|
||||
+21
-1
@@ -1,7 +1,11 @@
|
||||
// Package client provides HTTP client primitives for the Telegram Bot API.
|
||||
package client
|
||||
|
||||
import "github.com/goccy/go-json"
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
)
|
||||
|
||||
// Codec encodes/decodes JSON payloads exchanged with the Telegram Bot API.
|
||||
// The default implementation wraps goccy/go-json. Users may plug in
|
||||
@@ -12,6 +16,15 @@ type Codec interface {
|
||||
Unmarshal(data []byte, v any) error
|
||||
}
|
||||
|
||||
// BodyEncoder is an optional Codec extension that encodes directly into
|
||||
// an io.Writer, skipping the intermediate []byte that Marshal returns.
|
||||
// Call uses this when present to avoid allocating the marshal result and
|
||||
// the bytes.Reader that wraps it; codecs without it fall through to
|
||||
// Marshal + bytes.NewReader.
|
||||
type BodyEncoder interface {
|
||||
MarshalTo(w io.Writer, v any) error
|
||||
}
|
||||
|
||||
// DefaultCodec wraps goccy/go-json. It is the zero-value safe default.
|
||||
type DefaultCodec struct{}
|
||||
|
||||
@@ -20,3 +33,10 @@ func (DefaultCodec) Marshal(v any) ([]byte, error) { return json.Marshal(v) }
|
||||
|
||||
// Unmarshal calls json.Unmarshal.
|
||||
func (DefaultCodec) Unmarshal(data []byte, v any) error { return json.Unmarshal(data, v) }
|
||||
|
||||
// MarshalTo encodes v into w via goccy/go-json's streaming encoder. The
|
||||
// trailing newline that Encoder appends is valid JSON whitespace and is
|
||||
// accepted by Telegram's parser.
|
||||
func (DefaultCodec) MarshalTo(w io.Writer, v any) error {
|
||||
return json.NewEncoder(w).Encode(v)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/valyala/fasthttp"
|
||||
)
|
||||
|
||||
// FastHTTPDoer is an HTTPDoer backed by github.com/valyala/fasthttp. It
|
||||
// trades net/http compatibility (and HTTP/2 support) for substantially
|
||||
// fewer allocations per request — fasthttp pools its Request and Response
|
||||
// objects and uses a zero-allocation HTTP/1.1 parser.
|
||||
//
|
||||
// Use it for high-throughput bots when GC pressure matters and you don't
|
||||
// need HTTP/2 or any net/http-only middleware (RoundTripper composition,
|
||||
// the OpenTelemetry httptrace family, etc.):
|
||||
//
|
||||
// bot := client.New(token, client.WithHTTPClient(client.NewFastHTTPDoer()))
|
||||
//
|
||||
// Wrap with RetryDoer the same way you would the default doer.
|
||||
type FastHTTPDoer struct {
|
||||
client *fasthttp.Client
|
||||
// readTimeout is the per-request timeout when the inbound ctx has no
|
||||
// deadline. Defaults to 30s; long-poll updates need a longer one — see
|
||||
// WithFastHTTPReadTimeout.
|
||||
readTimeout time.Duration
|
||||
}
|
||||
|
||||
// FastHTTPDoerOption configures a FastHTTPDoer.
|
||||
type FastHTTPDoerOption func(*FastHTTPDoer)
|
||||
|
||||
// WithFastHTTPClient swaps in a pre-configured *fasthttp.Client.
|
||||
// Useful for sharing a connection pool across multiple bots or applying
|
||||
// custom dial / TLS configuration.
|
||||
func WithFastHTTPClient(c *fasthttp.Client) FastHTTPDoerOption {
|
||||
return func(d *FastHTTPDoer) { d.client = c }
|
||||
}
|
||||
|
||||
// WithFastHTTPReadTimeout sets the per-request fallback timeout used when
|
||||
// the inbound context has no deadline. Long-poll callers should pass a
|
||||
// value larger than the long-poll timeout.
|
||||
func WithFastHTTPReadTimeout(t time.Duration) FastHTTPDoerOption {
|
||||
return func(d *FastHTTPDoer) { d.readTimeout = t }
|
||||
}
|
||||
|
||||
// NewFastHTTPDoer constructs a FastHTTPDoer with sensible defaults.
|
||||
func NewFastHTTPDoer(opts ...FastHTTPDoerOption) *FastHTTPDoer {
|
||||
d := &FastHTTPDoer{
|
||||
client: &fasthttp.Client{
|
||||
ReadTimeout: 90 * time.Second,
|
||||
WriteTimeout: 30 * time.Second,
|
||||
MaxIdleConnDuration: 90 * time.Second,
|
||||
},
|
||||
readTimeout: 30 * time.Second,
|
||||
}
|
||||
for _, o := range opts {
|
||||
o(d)
|
||||
}
|
||||
return d
|
||||
}
|
||||
|
||||
// Do satisfies HTTPDoer by translating req into a pooled fasthttp.Request,
|
||||
// dispatching it, and returning a *http.Response whose Body releases the
|
||||
// pooled fasthttp.Response when Close is called.
|
||||
//
|
||||
// The conversion is intentionally minimal: URL goes via req.URL.RequestURI()
|
||||
// + Host (avoids re-parsing), header values move byte-for-byte, and the
|
||||
// body is taken straight from req.Body. *bytes.Buffer / *bytes.Reader are
|
||||
// recognised so we can pass the underlying bytes without io.ReadAll.
|
||||
func (d *FastHTTPDoer) Do(req *http.Request) (*http.Response, error) {
|
||||
if req == nil {
|
||||
return nil, errors.New("client: nil http.Request")
|
||||
}
|
||||
|
||||
fReq := fasthttp.AcquireRequest()
|
||||
defer fasthttp.ReleaseRequest(fReq)
|
||||
|
||||
fReq.SetRequestURI(req.URL.String())
|
||||
fReq.Header.SetMethod(req.Method)
|
||||
if req.Host != "" {
|
||||
fReq.Header.SetHost(req.Host)
|
||||
}
|
||||
for name, values := range req.Header {
|
||||
for _, v := range values {
|
||||
fReq.Header.Set(name, v)
|
||||
}
|
||||
}
|
||||
|
||||
if err := setFastHTTPBody(fReq, req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
fResp := fasthttp.AcquireResponse()
|
||||
// fResp is released by fasthttpResponseBody.Close — caller is
|
||||
// expected to defer resp.Body.Close() per net/http contract.
|
||||
|
||||
deadline, hasDeadline := req.Context().Deadline()
|
||||
var err error
|
||||
if hasDeadline {
|
||||
err = d.client.DoDeadline(fReq, fResp, deadline)
|
||||
} else {
|
||||
err = d.client.DoTimeout(fReq, fResp, d.readTimeout)
|
||||
}
|
||||
if err != nil {
|
||||
fasthttp.ReleaseResponse(fResp)
|
||||
// Map fasthttp's timeout error to ctx.Err semantics so callers
|
||||
// can errors.Is(err, context.DeadlineExceeded).
|
||||
if hasDeadline && errors.Is(err, fasthttp.ErrTimeout) {
|
||||
return nil, context.DeadlineExceeded
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
httpResp := &http.Response{
|
||||
StatusCode: fResp.StatusCode(),
|
||||
Status: strconv.Itoa(fResp.StatusCode()) + " " + fastHTTPStatusText(fResp.StatusCode()),
|
||||
Header: make(http.Header, fResp.Header.Len()),
|
||||
ContentLength: int64(fResp.Header.ContentLength()),
|
||||
Body: &fasthttpResponseBody{resp: fResp, body: fResp.Body()},
|
||||
Request: req,
|
||||
Proto: "HTTP/1.1",
|
||||
ProtoMajor: 1,
|
||||
ProtoMinor: 1,
|
||||
}
|
||||
for k, v := range fResp.Header.All() {
|
||||
httpResp.Header.Add(string(k), string(v))
|
||||
}
|
||||
return httpResp, nil
|
||||
}
|
||||
|
||||
// setFastHTTPBody copies req.Body into fReq with the cheapest path that
|
||||
// preserves correctness. The bufferReadCloser / readerReadCloser shapes
|
||||
// produced by buildRequest expose their backing []byte directly so we
|
||||
// can call SetBodyRaw without io.ReadAll. Other body types fall through
|
||||
// to SetBodyStream when ContentLength is known, otherwise to ReadAll.
|
||||
func setFastHTTPBody(fReq *fasthttp.Request, req *http.Request) error {
|
||||
if req.Body == nil {
|
||||
return nil
|
||||
}
|
||||
switch v := req.Body.(type) {
|
||||
case bufferReadCloser:
|
||||
fReq.SetBodyRaw(v.Bytes())
|
||||
return nil
|
||||
case readerReadCloser:
|
||||
// *bytes.Reader.Bytes() returns the unread portion.
|
||||
size := v.Len()
|
||||
buf := make([]byte, size)
|
||||
_, err := v.Read(buf)
|
||||
if err != nil && !errors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
fReq.SetBodyRaw(buf)
|
||||
return nil
|
||||
default:
|
||||
if req.ContentLength > 0 {
|
||||
fReq.SetBodyStream(v, int(req.ContentLength))
|
||||
} else {
|
||||
body, err := io.ReadAll(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fReq.SetBodyRaw(body)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// fasthttpResponseBody adapts a pooled *fasthttp.Response so it satisfies
|
||||
// io.ReadCloser. The body bytes alias the response's internal buffer; when
|
||||
// Close fires we return the response to the fasthttp pool. Callers must
|
||||
// finish reading before invoking Close (the same contract net/http
|
||||
// requires).
|
||||
type fasthttpResponseBody struct {
|
||||
resp *fasthttp.Response
|
||||
body []byte
|
||||
pos int
|
||||
}
|
||||
|
||||
func (b *fasthttpResponseBody) Read(p []byte) (int, error) {
|
||||
if b.pos >= len(b.body) {
|
||||
return 0, io.EOF
|
||||
}
|
||||
n := copy(p, b.body[b.pos:])
|
||||
b.pos += n
|
||||
return n, nil
|
||||
}
|
||||
|
||||
func (b *fasthttpResponseBody) Close() error {
|
||||
if b.resp != nil {
|
||||
fasthttp.ReleaseResponse(b.resp)
|
||||
b.resp = nil
|
||||
b.body = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// fastHTTPStatusText returns the textual reason phrase for a status code,
|
||||
// matching the format net/http produces for *http.Response.Status. We
|
||||
// hard-code the common cases the Telegram Bot API actually returns; for
|
||||
// everything else we fall back to the stdlib helper.
|
||||
func fastHTTPStatusText(code int) string {
|
||||
switch code {
|
||||
case http.StatusOK:
|
||||
return "OK"
|
||||
case http.StatusBadRequest:
|
||||
return "Bad Request"
|
||||
case http.StatusUnauthorized:
|
||||
return "Unauthorized"
|
||||
case http.StatusForbidden:
|
||||
return "Forbidden"
|
||||
case http.StatusNotFound:
|
||||
return "Not Found"
|
||||
case http.StatusTooManyRequests:
|
||||
return "Too Many Requests"
|
||||
case http.StatusInternalServerError:
|
||||
return "Internal Server Error"
|
||||
case http.StatusBadGateway:
|
||||
return "Bad Gateway"
|
||||
case http.StatusServiceUnavailable:
|
||||
return "Service Unavailable"
|
||||
case http.StatusGatewayTimeout:
|
||||
return "Gateway Timeout"
|
||||
default:
|
||||
return http.StatusText(code)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestFastHTTPDoer_BasicRoundTrip(t *testing.T) {
|
||||
got := make(chan struct{ method, ct, body string }, 1)
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
body, _ := io.ReadAll(r.Body)
|
||||
got <- struct{ method, ct, body string }{r.Method, r.Header.Get("Content-Type"), string(body)}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_, _ = io.WriteString(w, `{"ok":true,"result":42}`)
|
||||
}))
|
||||
defer srv.Close()
|
||||
|
||||
d := NewFastHTTPDoer()
|
||||
req, err := http.NewRequest(http.MethodPost, srv.URL+"/sendMessage", strings.NewReader(`{"chat_id":1,"text":"hi"}`))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
req = req.WithContext(context.Background())
|
||||
|
||||
resp, err := d.Do(req)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
|
||||
if resp.StatusCode != 200 {
|
||||
t.Fatalf("status: got %d", resp.StatusCode)
|
||||
}
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
if string(body) != `{"ok":true,"result":42}` {
|
||||
t.Fatalf("body: got %q", body)
|
||||
}
|
||||
|
||||
rec := <-got
|
||||
if rec.method != http.MethodPost {
|
||||
t.Fatalf("method: got %q", rec.method)
|
||||
}
|
||||
if rec.ct != "application/json" {
|
||||
t.Fatalf("content-type: got %q", rec.ct)
|
||||
}
|
||||
if rec.body != `{"chat_id":1,"text":"hi"}` {
|
||||
t.Fatalf("body: got %q", rec.body)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFastHTTPDoer_HonoursContextDeadline(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
_, _ = io.WriteString(w, "ok")
|
||||
}))
|
||||
defer srv.Close()
|
||||
|
||||
d := NewFastHTTPDoer(WithFastHTTPReadTimeout(time.Hour))
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Millisecond)
|
||||
defer cancel()
|
||||
req, _ := http.NewRequest(http.MethodGet, srv.URL, nil)
|
||||
req = req.WithContext(ctx)
|
||||
|
||||
_, err := d.Do(req)
|
||||
if err == nil {
|
||||
t.Fatal("expected timeout error, got nil")
|
||||
}
|
||||
}
|
||||
|
||||
func TestFastHTTPDoer_IntegratesWithBot(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
_, _ = io.WriteString(w, `{"ok":true,"result":{"message_id":7,"date":0,"text":"hi"}}`)
|
||||
}))
|
||||
defer srv.Close()
|
||||
|
||||
bot := New("123:abc",
|
||||
WithBaseURL(srv.URL),
|
||||
WithHTTPClient(NewFastHTTPDoer()),
|
||||
)
|
||||
req := &benchSendReq{ChatID: 1, Text: "hi"}
|
||||
got, err := Call[*benchSendReq, benchMsgResp](context.Background(), bot, "sendMessage", req)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got.MessageID != 7 || got.Text != "hi" {
|
||||
t.Fatalf("got %+v", got)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
telemetry "github.com/lukaszraczylo/oss-telemetry"
|
||||
)
|
||||
|
||||
// telemetryOnce guards the single anonymous "library used" ping that is sent
|
||||
// on the first call to New. Long-running bots typically construct one Bot;
|
||||
// short-lived programs or test suites may construct many, but the Once gate
|
||||
// keeps the fire-and-forget call from amplifying into per-construction pings.
|
||||
var telemetryOnce sync.Once
|
||||
|
||||
// fireTelemetryOnce dispatches a fire-and-forget anonymous adoption ping.
|
||||
//
|
||||
// The call is failproof by contract of oss-telemetry: it never blocks New,
|
||||
// never panics, never returns errors, and silently no-ops if disabled or
|
||||
// if the network is unavailable.
|
||||
//
|
||||
// Opt-out is honored via any of these environment variables (case-insensitive
|
||||
// truthy values "1", "true", "yes", "on"):
|
||||
//
|
||||
// - DO_NOT_TRACK
|
||||
// - OSS_TELEMETRY_DISABLED
|
||||
// - GO_TELEGRAM_DISABLE_TELEMETRY
|
||||
//
|
||||
// See README §Telemetry for the full disclosure.
|
||||
func fireTelemetryOnce() {
|
||||
telemetryOnce.Do(func() {
|
||||
telemetry.SendForModule("go-telegram", "github.com/lukaszraczylo/go-telegram", Version)
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"os"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
telemetry "github.com/lukaszraczylo/oss-telemetry"
|
||||
)
|
||||
|
||||
// TestMain disables outgoing telemetry for the duration of this package's
|
||||
// test suite. The library's own tests construct many Bot instances; without
|
||||
// this guard they would each contribute a real ping to the public endpoint.
|
||||
// End-user test suites that construct Bot are not affected by this — only
|
||||
// tests inside this package are.
|
||||
func TestMain(m *testing.M) {
|
||||
telemetry.Disable()
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
// TestFireTelemetryOnce_OnlyFiresOnce verifies the sync.Once gate. Even if
|
||||
// New is called repeatedly, the underlying telemetry.Send is invoked at most
|
||||
// once per process. We can't observe the network call directly (telemetry
|
||||
// is disabled here via TestMain) so we assert on the once-Do count via a
|
||||
// fresh local sync.Once paralleling the production one.
|
||||
func TestFireTelemetryOnce_OnlyFiresOnce(t *testing.T) {
|
||||
// Reset the package-level Once so this test starts from a clean state.
|
||||
telemetryOnce = sync.Once{}
|
||||
t.Cleanup(func() { telemetryOnce = sync.Once{} })
|
||||
|
||||
calls := 0
|
||||
probe := func() { telemetryOnce.Do(func() { calls++ }) }
|
||||
|
||||
for i := 0; i < 50; i++ {
|
||||
probe()
|
||||
}
|
||||
if calls != 1 {
|
||||
t.Fatalf("expected exactly 1 Once execution, got %d", calls)
|
||||
}
|
||||
}
|
||||
|
||||
// TestNew_DoesNotPanicUnderRepeatedConstruction is a smoke test that
|
||||
// telemetry wiring does not affect New's existing contract. New must never
|
||||
// panic, regardless of telemetry state.
|
||||
func TestNew_DoesNotPanicUnderRepeatedConstruction(t *testing.T) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
t.Fatalf("New panicked: %v", r)
|
||||
}
|
||||
}()
|
||||
for i := 0; i < 20; i++ {
|
||||
_ = New("test-token-" + string(rune('A'+i)))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package client
|
||||
|
||||
// Version is a fallback version string used only when Go's build info is
|
||||
// unavailable (replace directives, detached `go run`) or has been overridden
|
||||
// via linker flags. The authoritative version forwarded to telemetry is
|
||||
// resolved at runtime by [telemetry.SendForModule] from the build info of
|
||||
// whatever binary linked this library, so this constant does NOT need to be
|
||||
// bumped on every release. Exposed as a var (not const) for ldflag override:
|
||||
//
|
||||
// go build -ldflags="-X github.com/lukaszraczylo/go-telegram/client.Version=1.2.3"
|
||||
var Version = "0.0.0-fallback"
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
## TL;DR
|
||||
|
||||
- **Webhook decode** (small Update): ours is **15–19% faster** than every competitor and ties telego for the lowest alloc count (11).
|
||||
- **Large Update unmarshal** (entities + reply markup + photo array): ours is **17–35% faster** with the lowest ns/op of all six. telego edges us on alloc count (31 vs 34) at the cost of ~17% more time.
|
||||
- **API call round-trip** (mock HTTP server): telego wins (36.3 µs / 48 allocs) thanks to its custom binder; ours is second (38.95 µs / 104 allocs) and beats gotba, telebot, gobot.
|
||||
- **Dispatcher routing** (20 handlers, last matches): ours is **2.5× faster than telebot and gobot** (101 ns vs 269 / 252 ns).
|
||||
- **Webhook decode** (small Update): ours is **12–20% faster** than every competitor and ties telego for the lowest alloc count (11).
|
||||
- **Large Update unmarshal** (entities + reply markup + photo array): ours is **17–34% faster** with the lowest ns/op of all six. telego edges us on alloc count (31 vs 34) at the cost of ~17% more time.
|
||||
- **API call round-trip** (mock HTTP server): telego wins on allocs (35.8 µs / 48 allocs) because it uses fasthttp by default. We default to `net/http` (102 allocs / 39.8 µs); with the opt-in `client.NewFastHTTPDoer` we drop to 56 allocs / 6.6 KiB — within 8 of telego while keeping `*http.Request` semantics (RetryDoer, middleware, generated tests).
|
||||
- **Dispatcher routing** (20 handlers, last matches): ours is **2.5–2.8× faster than telebot and gobot** (98 ns vs 271 / 246 ns).
|
||||
|
||||
## How to read these numbers
|
||||
|
||||
@@ -37,12 +37,12 @@ Decode `shared.SmallUpdateJSON` into the library's typed `Update` struct.
|
||||
|
||||
| Lib | sec/op | B/op | allocs/op |
|
||||
|-----|--------|------|-----------|
|
||||
| **ours** | **1.743 µs ±3%** | 2.180 KiB | **11** |
|
||||
| gotba | 2.016 µs ±3% | 1.461 KiB | 17 |
|
||||
| telebot | 2.073 µs ±3% | 1.773 KiB | 17 |
|
||||
| gobot | 1.999 µs ±1% | 1.789 KiB | 16 |
|
||||
| telego | 2.026 µs ±2% | 3.060 KiB | **11** |
|
||||
| echotron | 1.973 µs ±0% | 1.680 KiB | 16 |
|
||||
| **ours** | **1.832 µs ±4%** | 2.180 KiB | **11** |
|
||||
| gotba | 2.082 µs ±0% | 1.461 KiB | 17 |
|
||||
| telebot | 2.194 µs ±1% | 1.773 KiB | 17 |
|
||||
| gobot | 2.082 µs ±1% | 1.789 KiB | 16 |
|
||||
| telego | 2.143 µs ±2% | 3.058 KiB | **11** |
|
||||
| echotron | 2.039 µs ±1% | 1.680 KiB | 16 |
|
||||
|
||||
**Notes.** We use slightly more bytes because typed unions and the typed `[]UpdateType` allocate richer Go values. We win on time and tie telego on alloc count.
|
||||
|
||||
@@ -52,12 +52,12 @@ Decode `shared.LargeUpdateJSON` (text + 3 entities + 2x3 inline keyboard + 3-siz
|
||||
|
||||
| Lib | sec/op | B/op | allocs/op |
|
||||
|-----|--------|------|-----------|
|
||||
| **ours** | **6.667 µs ±4%** | 5.881 KiB | 34 |
|
||||
| gotba | 8.321 µs ±2% | 3.438 KiB | 56 |
|
||||
| telebot | 10.240 µs ±4% | 5.594 KiB | 60 |
|
||||
| gobot | 8.150 µs ±2% | 4.703 KiB | 50 |
|
||||
| telego | 7.797 µs ±1% | 6.621 KiB | **31** |
|
||||
| echotron | 8.072 µs ±0% | 4.219 KiB | 56 |
|
||||
| **ours** | **6.726 µs ±1%** | 5.875 KiB | 34 |
|
||||
| gotba | 8.066 µs ±1% | 3.438 KiB | 56 |
|
||||
| telebot | 10.190 µs ±1% | 5.594 KiB | 60 |
|
||||
| gobot | 8.231 µs ±1% | 4.703 KiB | 50 |
|
||||
| telego | 7.849 µs ±2% | 6.600 KiB | **31** |
|
||||
| echotron | 8.123 µs ±1% | 4.219 KiB | 56 |
|
||||
|
||||
**Notes.** Despite the typed-union model giving us richer Go values per decode, we still produce them faster than every competitor. telego edges us by 3 allocs but pays 17% more time.
|
||||
|
||||
@@ -67,15 +67,19 @@ Build params → POST to local `httptest.Server` returning `{"ok":true,"result":
|
||||
|
||||
| Lib | sec/op | B/op | allocs/op |
|
||||
|-----|--------|------|-----------|
|
||||
| ours | 38.95 µs ±3% | 11.17 KiB | 104 |
|
||||
| gotba | 41.95 µs ±2% | 10.95 KiB | 125 |
|
||||
| telebot | 43.63 µs ±0% | 13.16 KiB | 139 |
|
||||
| gobot | 61.11 µs ±1% | 13.51 KiB | 176 |
|
||||
| **telego** | **36.31 µs ±1%** | **6.556 KiB** | **48** |
|
||||
| ours (default `net/http`) | 39.83 µs ±4% | 11.09 KiB | 102 |
|
||||
| ours (opt-in `fasthttp`) | *time TBD on quiet box* | **6.62 KiB** | **56** |
|
||||
| gotba | 42.03 µs ±4% | 10.97 KiB | 125 |
|
||||
| telebot | 43.41 µs ±1% | 13.15 KiB | 139 |
|
||||
| gobot | 61.19 µs ±1% | 13.50 KiB | 176 |
|
||||
| **telego** (uses fasthttp) | **35.84 µs ±1%** | **6.547 KiB** | **48** |
|
||||
| echotron | *skipped — see below* | — | — |
|
||||
|
||||
**Notes.**
|
||||
- telego wins by sending requests as `application/x-www-form-urlencoded` form data (cheaper than JSON marshal+upload for small payloads), plus an aggressive request-pool. We send JSON over `multipart/form-data` only when needed; for the JSON case our cost lands between gotba and telego.
|
||||
- The headline alloc gap to telego turned out to be transport choice: telego defaults to [`fasthttp`](https://github.com/valyala/fasthttp), which pools requests/responses and skips most of `net/http`'s bookkeeping. Most of the other libs (and us, by default) use `net/http`.
|
||||
- We ship an opt-in fasthttp doer (`client.NewFastHTTPDoer`). Plug it via `client.WithHTTPClient(client.NewFastHTTPDoer())` and per-call allocs drop from 102 to **56** — within 8 of telego despite still going through our `*http.Request`-based `HTTPDoer` interface (kept that way so `RetryDoer`, custom transports, observability middleware, and the 1428 generated tests all keep working).
|
||||
- The default stays `net/http` because fasthttp is HTTP/1.1-only, can't be composed with the `RoundTripper` middleware ecosystem, and most users don't have the throughput to notice. Bots making thousands of API calls/sec should opt in.
|
||||
- Our `net/http` request path is already minimised: manually-constructed `*http.Request` with a pre-parsed base URL (cached on `*Bot`), and request bodies stream-encoded into a pooled `*bytes.Buffer` via the optional `BodyEncoder` codec extension. Those skip the `url.Parse` + `*http.Request` bookkeeping that `http.NewRequestWithContext` runs on every call.
|
||||
- gobot's higher cost comes from per-call goroutine + channel plumbing in its dispatcher path even when called directly.
|
||||
- **echotron skip:** echotron ships built-in dual-level rate limiting (30 req/s global, 20 req/min per chat) on its unexported `lclient` field. The setters that disable it (`SetGlobalRequestLimit`, `SetChatRequestLimit`) are methods on the unexported type with no public accessor through the `API` value, so the limiter cannot be bypassed without monkey-patching. A naive run produces ~3 s/op driven entirely by the per-chat token bucket — measuring rate limiting, not the library. We skip rather than publish a misleading number. The rate limiter is a feature of echotron and worth knowing about; it just makes a microbench unfair.
|
||||
|
||||
@@ -85,9 +89,9 @@ Register 20 command handlers (`/cmd0` … `/cmd19`); feed an update matching `/c
|
||||
|
||||
| Lib | sec/op | B/op | allocs/op |
|
||||
|-----|--------|------|-----------|
|
||||
| **ours** | **100.7 ns ±3%** | 128 B | 3 |
|
||||
| telebot | 269.2 ns ±5% | 678 B | 5 |
|
||||
| gobot | 251.5 ns ±4% | **48 B** | **1** |
|
||||
| **ours** | **98.46 ns ±2%** | 128 B | 3 |
|
||||
| telebot | 270.9 ns ±2% | 678 B | 5 |
|
||||
| gobot | 246.1 ns ±1% | **48 B** | **1** |
|
||||
|
||||
**Notes.** We dispatch ~2.5× faster than telebot and gobot. gobot's single allocation is impressive but its routing decision is slower. telebot's higher cost reflects its richer per-update `Context` construction.
|
||||
|
||||
|
||||
+140
-140
@@ -2142,7 +2142,7 @@ Use this method to send answers to callback queries sent from inline keyboards.
|
||||
type AnswerCallbackQueryParams struct {
|
||||
// Unique identifier for the query to be answered
|
||||
CallbackQueryID string `json:"callback_query_id"`
|
||||
// Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters
|
||||
// Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters.
|
||||
Text string `json:"text,omitempty"`
|
||||
// If True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
|
||||
ShowAlert *bool `json:"show_alert,omitempty"`
|
||||
@@ -2276,7 +2276,7 @@ type ApproveSuggestedPostParams struct {
|
||||
ChatID int64 `json:"chat_id"`
|
||||
// Identifier of a suggested post message to approve
|
||||
MessageID int64 `json:"message_id"`
|
||||
// Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must be not more than 2678400 seconds (30 days) in the future
|
||||
// Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must be not more than 2678400 seconds (30 days) in the future.
|
||||
SendDate *int64 `json:"send_date,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -2546,7 +2546,7 @@ type BackgroundTypePattern struct {
|
||||
Fill BackgroundFill `json:"fill"`
|
||||
// Intensity of the pattern when it is shown above the filled background; 0-100
|
||||
Intensity int64 `json:"intensity"`
|
||||
// Optional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only
|
||||
// Optional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only.
|
||||
IsInverted *bool `json:"is_inverted,omitempty"`
|
||||
// Optional. True, if the background moves slightly when the device is tilted
|
||||
IsMoving *bool `json:"is_moving,omitempty"`
|
||||
@@ -2686,7 +2686,7 @@ This object represents a bot command.
|
||||
type BotCommand struct {
|
||||
// Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
|
||||
Command string `json:"command"`
|
||||
// Description of the command; 1-256 characters.
|
||||
// Description of the command; 1-256 characters
|
||||
Description string `json:"description"`
|
||||
}
|
||||
```
|
||||
@@ -3138,7 +3138,7 @@ type CallbackQuery struct {
|
||||
From User `json:"from"`
|
||||
// Optional. Message sent by the bot with the callback button that originated the query
|
||||
Message MaybeInaccessibleMessage `json:"message,omitempty"`
|
||||
// Optional. Identifier of the message sent via the bot in inline mode, that originated the query.
|
||||
// Optional. Identifier of the message sent via the bot in inline mode, that originated the query
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
// Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
|
||||
ChatInstance string `json:"chat_instance"`
|
||||
@@ -3567,7 +3567,7 @@ type ChatFullInfo struct {
|
||||
FirstProfileAudio *Audio `json:"first_profile_audio,omitempty"`
|
||||
// Optional. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews
|
||||
UniqueGiftColors *UniqueGiftColors `json:"unique_gift_colors,omitempty"`
|
||||
// Optional. The number of Telegram Stars a general user have to pay to send a message to the chat
|
||||
// Optional. The number of Telegram Stars a general user has to pay to send a message to the chat
|
||||
PaidMessageStarCount *int64 `json:"paid_message_star_count,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -3759,7 +3759,7 @@ type ChatJoinRequest struct {
|
||||
UserChatID int64 `json:"user_chat_id"`
|
||||
// Date the request was sent in Unix time
|
||||
Date int64 `json:"date"`
|
||||
// Optional. Bio of the user.
|
||||
// Optional. Bio of the user
|
||||
Bio string `json:"bio,omitempty"`
|
||||
// Optional. Chat invite link that was used by the user to send the join request
|
||||
InviteLink *ChatInviteLink `json:"invite_link,omitempty"`
|
||||
@@ -3903,7 +3903,7 @@ type ChatMemberBanned struct {
|
||||
Status ChatMemberStatus `json:"status"`
|
||||
// Information about the user
|
||||
User User `json:"user"`
|
||||
// Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever
|
||||
// Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever.
|
||||
UntilDate int64 `json:"until_date"`
|
||||
}
|
||||
```
|
||||
@@ -4041,7 +4041,7 @@ type ChatMemberRestricted struct {
|
||||
CanPinMessages bool `json:"can_pin_messages"`
|
||||
// True, if the user is allowed to create forum topics
|
||||
CanManageTopics bool `json:"can_manage_topics"`
|
||||
// Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever
|
||||
// Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever.
|
||||
UntilDate int64 `json:"until_date"`
|
||||
}
|
||||
```
|
||||
@@ -4094,7 +4094,7 @@ type ChatMemberUpdated struct {
|
||||
OldChatMember ChatMember `json:"old_chat_member"`
|
||||
// New information about the chat member
|
||||
NewChatMember ChatMember `json:"new_chat_member"`
|
||||
// Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
|
||||
// Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only
|
||||
InviteLink *ChatInviteLink `json:"invite_link,omitempty"`
|
||||
// Optional. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator
|
||||
ViaJoinRequest *bool `json:"via_join_request,omitempty"`
|
||||
@@ -4167,13 +4167,13 @@ type ChatPermissions struct {
|
||||
CanReactToMessages *bool `json:"can_react_to_messages,omitempty"`
|
||||
// Optional. True, if the user is allowed to edit their own tag. If omitted, defaults to the value of can_pin_messages.
|
||||
CanEditTag *bool `json:"can_edit_tag,omitempty"`
|
||||
// Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
|
||||
// Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups.
|
||||
CanChangeInfo *bool `json:"can_change_info,omitempty"`
|
||||
// Optional. True, if the user is allowed to invite new users to the chat
|
||||
CanInviteUsers *bool `json:"can_invite_users,omitempty"`
|
||||
// Optional. True, if the user is allowed to pin messages. Ignored in public supergroups
|
||||
// Optional. True, if the user is allowed to pin messages. Ignored in public supergroups.
|
||||
CanPinMessages *bool `json:"can_pin_messages,omitempty"`
|
||||
// Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages
|
||||
// Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages.
|
||||
CanManageTopics *bool `json:"can_manage_topics,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -4207,9 +4207,9 @@ type ChatShared struct {
|
||||
RequestID int64 `json:"request_id"`
|
||||
// Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.
|
||||
ChatID int64 `json:"chat_id"`
|
||||
// Optional. Title of the chat, if the title was requested by the bot.
|
||||
// Optional. Title of the chat, if the title was requested by the bot
|
||||
Title string `json:"title,omitempty"`
|
||||
// Optional. Username of the chat, if the username was requested by the bot and available.
|
||||
// Optional. Username of the chat, if the username was requested by the bot and available
|
||||
Username string `json:"username,omitempty"`
|
||||
// Optional. Available sizes of the chat photo, if the photo was requested by the bot
|
||||
Photo []PhotoSize `json:"photo,omitempty"`
|
||||
@@ -4427,7 +4427,7 @@ type CopyMessageParams struct {
|
||||
MessageID int64 `json:"message_id"`
|
||||
// New start timestamp for the copied video in the message
|
||||
VideoStartTimestamp *int64 `json:"video_start_timestamp,omitempty"`
|
||||
// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
|
||||
// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept.
|
||||
Caption string `json:"caption,omitempty"`
|
||||
// Mode for parsing entities in the new caption. See formatting options for more details.
|
||||
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
||||
@@ -4447,7 +4447,7 @@ type CopyMessageParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -4509,7 +4509,7 @@ type CreateChatInviteLinkParams struct {
|
||||
ExpireDate *int64 `json:"expire_date,omitempty"`
|
||||
// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
|
||||
MemberLimit *int64 `json:"member_limit,omitempty"`
|
||||
// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified
|
||||
// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified.
|
||||
CreatesJoinRequest *bool `json:"creates_join_request,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -4547,7 +4547,7 @@ type CreateForumTopicParams struct {
|
||||
ChatID ChatID `json:"chat_id"`
|
||||
// Topic name, 1-128 characters
|
||||
Name string `json:"name"`
|
||||
// Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F)
|
||||
// Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F).
|
||||
IconColor *int64 `json:"icon_color,omitempty"`
|
||||
// Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers.
|
||||
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
|
||||
@@ -4677,7 +4677,7 @@ Use this method to remove up to 10000 recent reactions in a group or a supergrou
|
||||
|
||||
```go
|
||||
type DeleteAllMessageReactionsParams struct {
|
||||
// Unique identifier for the target chat or username of the target supergroup (in the format @username)
|
||||
// Unique identifier for the target chat or username of the target supergroup in the format @username
|
||||
ChatID ChatID `json:"chat_id"`
|
||||
// Identifier of the user whose reactions will be removed, if the reactions were added by a user
|
||||
UserID *int64 `json:"user_id,omitempty"`
|
||||
@@ -4697,7 +4697,7 @@ Delete messages on behalf of a business account. Requires the can\_delete\_sent\
|
||||
type DeleteBusinessMessagesParams struct {
|
||||
// Unique identifier of the business connection on behalf of which to delete the messages
|
||||
BusinessConnectionID string `json:"business_connection_id"`
|
||||
// A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted
|
||||
// A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted.
|
||||
MessageIds []int64 `json:"message_ids"`
|
||||
}
|
||||
```
|
||||
@@ -4771,7 +4771,7 @@ Use this method to remove a reaction from a message in a group or a supergroup c
|
||||
|
||||
```go
|
||||
type DeleteMessageReactionParams struct {
|
||||
// Unique identifier for the target chat or username of the target supergroup (in the format @username)
|
||||
// Unique identifier for the target chat or username of the target supergroup in the format @username
|
||||
ChatID ChatID `json:"chat_id"`
|
||||
// Identifier of the target message
|
||||
MessageID int64 `json:"message_id"`
|
||||
@@ -4793,7 +4793,7 @@ Use this method to delete multiple messages simultaneously. If some of the speci
|
||||
type DeleteMessagesParams struct {
|
||||
// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
|
||||
ChatID ChatID `json:"chat_id"`
|
||||
// A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted
|
||||
// A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted.
|
||||
MessageIds []int64 `json:"message_ids"`
|
||||
}
|
||||
```
|
||||
@@ -4809,7 +4809,7 @@ Use this method to delete the list of the bot's commands for the given scope and
|
||||
type DeleteMyCommandsParams struct {
|
||||
// A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
|
||||
Scope BotCommandScope `json:"scope,omitempty"`
|
||||
// A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
|
||||
// A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands.
|
||||
LanguageCode string `json:"language_code,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -4931,7 +4931,7 @@ Describes a topic of a direct messages chat.
|
||||
type DirectMessagesTopic struct {
|
||||
// Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
|
||||
TopicID int64 `json:"topic_id"`
|
||||
// Optional. Information about the user that created the topic. Currently, it is always present
|
||||
// Optional. Information about the user that created the topic. Currently, it is always present.
|
||||
User *User `json:"user,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -4977,7 +4977,7 @@ type EditChatInviteLinkParams struct {
|
||||
ExpireDate *int64 `json:"expire_date,omitempty"`
|
||||
// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
|
||||
MemberLimit *int64 `json:"member_limit,omitempty"`
|
||||
// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified
|
||||
// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified.
|
||||
CreatesJoinRequest *bool `json:"creates_join_request,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -5013,9 +5013,9 @@ type EditForumTopicParams struct {
|
||||
ChatID ChatID `json:"chat_id"`
|
||||
// Unique identifier for the target message thread of the forum topic
|
||||
MessageThreadID int64 `json:"message_thread_id"`
|
||||
// New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept
|
||||
// New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept.
|
||||
Name string `json:"name,omitempty"`
|
||||
// New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept
|
||||
// New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept.
|
||||
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -5049,9 +5049,9 @@ type EditMessageCaptionParams struct {
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
|
||||
ChatID *ChatID `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
// New caption of the message, 0-1024 characters after entities parsing
|
||||
Caption string `json:"caption,omitempty"`
|
||||
@@ -5061,7 +5061,7 @@ type EditMessageCaptionParams struct {
|
||||
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
|
||||
// Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages.
|
||||
ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"`
|
||||
// A JSON-serialized object for an inline keyboard.
|
||||
// A JSON-serialized object for an inline keyboard
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -5101,15 +5101,15 @@ type EditMessageLiveLocationParams struct {
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
|
||||
ChatID *ChatID `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
// Latitude of new location
|
||||
Latitude float64 `json:"latitude"`
|
||||
// Longitude of new location
|
||||
Longitude float64 `json:"longitude"`
|
||||
// New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged
|
||||
// New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged.
|
||||
LivePeriod *int64 `json:"live_period,omitempty"`
|
||||
// The radius of uncertainty for the location, measured in meters; 0-1500
|
||||
HorizontalAccuracy *float64 `json:"horizontal_accuracy,omitempty"`
|
||||
@@ -5117,7 +5117,7 @@ type EditMessageLiveLocationParams struct {
|
||||
Heading *int64 `json:"heading,omitempty"`
|
||||
// The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
|
||||
ProximityAlertRadius *int64 `json:"proximity_alert_radius,omitempty"`
|
||||
// A JSON-serialized object for a new inline keyboard.
|
||||
// A JSON-serialized object for a new inline keyboard
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -5135,13 +5135,13 @@ type EditMessageMediaParams struct {
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
|
||||
ChatID *ChatID `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
// A JSON-serialized object for a new media content of the message
|
||||
Media InputMedia `json:"media"`
|
||||
// A JSON-serialized object for a new inline keyboard.
|
||||
// A JSON-serialized object for a new inline keyboard
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -5186,11 +5186,11 @@ type EditMessageReplyMarkupParams struct {
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
|
||||
ChatID *ChatID `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
// A JSON-serialized object for an inline keyboard.
|
||||
// A JSON-serialized object for an inline keyboard
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -5208,9 +5208,9 @@ type EditMessageTextParams struct {
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
|
||||
ChatID *ChatID `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit
|
||||
// Required if inline_message_id is not specified. Identifier of the message to edit.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
// New text of the message, 1-4096 characters after entities parsing
|
||||
Text string `json:"text"`
|
||||
@@ -5220,7 +5220,7 @@ type EditMessageTextParams struct {
|
||||
Entities []MessageEntity `json:"entities,omitempty"`
|
||||
// Link preview generation options for the message
|
||||
LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"`
|
||||
// A JSON-serialized object for an inline keyboard.
|
||||
// A JSON-serialized object for an inline keyboard
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -5650,13 +5650,13 @@ type Game struct {
|
||||
Title string `json:"title"`
|
||||
// Description of the game
|
||||
Description string `json:"description"`
|
||||
// Photo that will be displayed in the game message in chats.
|
||||
// Photo that will be displayed in the game message in chats
|
||||
Photo []PhotoSize `json:"photo"`
|
||||
// Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
|
||||
Text string `json:"text,omitempty"`
|
||||
// Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
|
||||
TextEntities []MessageEntity `json:"text_entities,omitempty"`
|
||||
// Optional. Animation that will be displayed in the game message in chats. Upload via BotFather
|
||||
// Optional. Animation that will be displayed in the game message in chats. Upload via BotFather.
|
||||
Animation *Animation `json:"animation,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -5749,7 +5749,7 @@ type GetBusinessAccountGiftsParams struct {
|
||||
SortByPrice *bool `json:"sort_by_price,omitempty"`
|
||||
// Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
|
||||
Offset string `json:"offset,omitempty"`
|
||||
// The maximum number of gifts to be returned; 1-100. Defaults to 100
|
||||
// The maximum number of gifts to be returned; 1-100. Defaults to 100.
|
||||
Limit *int64 `json:"limit,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -5827,7 +5827,7 @@ type GetChatGiftsParams struct {
|
||||
SortByPrice *bool `json:"sort_by_price,omitempty"`
|
||||
// Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
|
||||
Offset string `json:"offset,omitempty"`
|
||||
// The maximum number of gifts to be returned; 1-100. Defaults to 100
|
||||
// The maximum number of gifts to be returned; 1-100. Defaults to 100.
|
||||
Limit *int64 `json:"limit,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -5871,7 +5871,7 @@ Use this method to get the current value of the bot's menu button in a private c
|
||||
|
||||
```go
|
||||
type GetChatMenuButtonParams struct {
|
||||
// Unique identifier for the target private chat. If not specified, default bot's menu button will be returned
|
||||
// Unique identifier for the target private chat. If not specified, the bot's default menu button will be returned.
|
||||
ChatID *int64 `json:"chat_id,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -5941,11 +5941,11 @@ Use this method to get data for high score tables. Will return the score of the
|
||||
type GetGameHighScoresParams struct {
|
||||
// Target user id
|
||||
UserID int64 `json:"user_id"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat.
|
||||
ChatID *int64 `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the sent message
|
||||
// Required if inline_message_id is not specified. Identifier of the sent message.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -6165,7 +6165,7 @@ type GetUserGiftsParams struct {
|
||||
SortByPrice *bool `json:"sort_by_price,omitempty"`
|
||||
// Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
|
||||
Offset string `json:"offset,omitempty"`
|
||||
// The maximum number of gifts to be returned; 1-100. Defaults to 100
|
||||
// The maximum number of gifts to be returned; 1-100. Defaults to 100.
|
||||
Limit *int64 `json:"limit,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -6311,7 +6311,7 @@ type GiftInfo struct {
|
||||
Entities []MessageEntity `json:"entities,omitempty"`
|
||||
// Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
|
||||
IsPrivate *bool `json:"is_private,omitempty"`
|
||||
// Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift
|
||||
// Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift.
|
||||
UniqueGiftNumber *int64 `json:"unique_gift_number,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -6512,7 +6512,7 @@ type InlineKeyboardButton struct {
|
||||
SwitchInlineQueryCurrentChat string `json:"switch_inline_query_current_chat,omitempty"`
|
||||
// Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a business account.
|
||||
SwitchInlineQueryChosenChat *SwitchInlineQueryChosenChat `json:"switch_inline_query_chosen_chat,omitempty"`
|
||||
// Optional. Description of the button that copies the specified text to the clipboard.
|
||||
// Optional. Description of the button that copies the specified text to the clipboard
|
||||
CopyText *CopyTextButton `json:"copy_text,omitempty"`
|
||||
// Optional. Description of the game that will be launched when the user presses the button.NOTE: This type of button must always be the first button in the first row.
|
||||
CallbackGame *CallbackGame `json:"callback_game,omitempty"`
|
||||
@@ -6548,7 +6548,7 @@ type InlineQuery struct {
|
||||
Query string `json:"query"`
|
||||
// Offset of the results to be returned, can be controlled by the bot
|
||||
Offset string `json:"offset"`
|
||||
// Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat
|
||||
// Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat.
|
||||
ChatType InlineQueryChatType `json:"chat_type,omitempty"`
|
||||
// Optional. Sender location, only for bots that request user location
|
||||
Location *Location `json:"location,omitempty"`
|
||||
@@ -7144,7 +7144,7 @@ type InlineQueryResultGif struct {
|
||||
GifDuration *int64 `json:"gif_duration,omitempty"`
|
||||
// URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
|
||||
ThumbnailURL string `json:"thumbnail_url"`
|
||||
// Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
|
||||
// Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”.
|
||||
ThumbnailMimeType InlineQueryResultGifThumbnailMimeType `json:"thumbnail_mime_type,omitempty"`
|
||||
// Optional. Title for the result
|
||||
Title string `json:"title,omitempty"`
|
||||
@@ -7210,7 +7210,7 @@ type InlineQueryResultLocation struct {
|
||||
Title string `json:"title"`
|
||||
// Optional. The radius of uncertainty for the location, measured in meters; 0-1500
|
||||
HorizontalAccuracy *float64 `json:"horizontal_accuracy,omitempty"`
|
||||
// Optional. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
|
||||
// Optional. Period in seconds during which the location can be updated, must be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely
|
||||
LivePeriod *int64 `json:"live_period,omitempty"`
|
||||
// Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
|
||||
Heading *int64 `json:"heading,omitempty"`
|
||||
@@ -7259,7 +7259,7 @@ type InlineQueryResultMpeg4Gif struct {
|
||||
Mpeg4Duration *int64 `json:"mpeg4_duration,omitempty"`
|
||||
// URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
|
||||
ThumbnailURL string `json:"thumbnail_url"`
|
||||
// Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
|
||||
// Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”.
|
||||
ThumbnailMimeType InlineQueryResultGifThumbnailMimeType `json:"thumbnail_mime_type,omitempty"`
|
||||
// Optional. Title for the result
|
||||
Title string `json:"title,omitempty"`
|
||||
@@ -7298,7 +7298,7 @@ type InlineQueryResultPhoto struct {
|
||||
Type InlineQueryResultType `json:"type"`
|
||||
// Unique identifier for this result, 1-64 bytes
|
||||
ID string `json:"id"`
|
||||
// A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB
|
||||
// A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB.
|
||||
PhotoURL string `json:"photo_url"`
|
||||
// URL of the thumbnail for the photo
|
||||
ThumbnailURL string `json:"thumbnail_url"`
|
||||
@@ -7666,7 +7666,7 @@ type InputLocationMessageContent struct {
|
||||
Longitude float64 `json:"longitude"`
|
||||
// Optional. The radius of uncertainty for the location, measured in meters; 0-1500
|
||||
HorizontalAccuracy *float64 `json:"horizontal_accuracy,omitempty"`
|
||||
// Optional. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
|
||||
// Optional. Period in seconds during which the location can be updated, must be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely
|
||||
LivePeriod *int64 `json:"live_period,omitempty"`
|
||||
// Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
|
||||
Heading *int64 `json:"heading,omitempty"`
|
||||
@@ -8227,9 +8227,9 @@ This object contains information about one answer option in a poll to be sent.
|
||||
type InputPollOption struct {
|
||||
// Option text, 1-100 characters
|
||||
Text string `json:"text"`
|
||||
// Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed
|
||||
// Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed.
|
||||
TextParseMode ParseMode `json:"text_parse_mode,omitempty"`
|
||||
// Optional. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode
|
||||
// Optional. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode.
|
||||
TextEntities []MessageEntity `json:"text_entities,omitempty"`
|
||||
// Optional. Media added to the poll option
|
||||
Media InputPollOptionMedia `json:"media,omitempty"`
|
||||
@@ -8558,7 +8558,7 @@ This object represents one button of the reply keyboard. At most one of the fiel
|
||||
|
||||
```go
|
||||
type KeyboardButton struct {
|
||||
// Text of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed
|
||||
// Text of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed.
|
||||
Text string `json:"text"`
|
||||
// Optional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.
|
||||
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
|
||||
@@ -8600,9 +8600,9 @@ This object defines the criteria used to request a suitable chat. Information ab
|
||||
|
||||
```go
|
||||
type KeyboardButtonRequestChat struct {
|
||||
// Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message
|
||||
// Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message.
|
||||
RequestID int64 `json:"request_id"`
|
||||
// Pass True to request a channel chat, pass False to request a group or a supergroup chat.
|
||||
// Pass True to request a channel chat, pass False to request a group or a supergroup chat
|
||||
ChatIsChannel bool `json:"chat_is_channel"`
|
||||
// Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.
|
||||
ChatIsForum *bool `json:"chat_is_forum,omitempty"`
|
||||
@@ -8632,7 +8632,7 @@ This object defines the parameters for the creation of a managed bot. Informatio
|
||||
|
||||
```go
|
||||
type KeyboardButtonRequestManagedBot struct {
|
||||
// Signed 32-bit identifier of the request. Must be unique within the message
|
||||
// Signed 32-bit identifier of the request. Must be unique within the message.
|
||||
RequestID int64 `json:"request_id"`
|
||||
// Optional. Suggested name for the bot
|
||||
SuggestedName string `json:"suggested_name,omitempty"`
|
||||
@@ -8648,7 +8648,7 @@ This object defines the criteria used to request suitable users. Information abo
|
||||
|
||||
```go
|
||||
type KeyboardButtonRequestUsers struct {
|
||||
// Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message
|
||||
// Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message.
|
||||
RequestID int64 `json:"request_id"`
|
||||
// Optional. Pass True to request bots, pass False to request regular users. If not specified, no additional restrictions are applied.
|
||||
UserIsBot *bool `json:"user_is_bot,omitempty"`
|
||||
@@ -8721,7 +8721,7 @@ Describes the options used for link preview generation.
|
||||
type LinkPreviewOptions struct {
|
||||
// Optional. True, if the link preview is disabled
|
||||
IsDisabled *bool `json:"is_disabled,omitempty"`
|
||||
// Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used
|
||||
// Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used.
|
||||
URL string `json:"url,omitempty"`
|
||||
// Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
|
||||
PreferSmallMedia *bool `json:"prefer_small_media,omitempty"`
|
||||
@@ -8819,11 +8819,11 @@ This object represents a parameter of the inline keyboard button used to automat
|
||||
type LoginUrl struct {
|
||||
// An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
|
||||
URL string `json:"url"`
|
||||
// Optional. New text of the button in forwarded messages.
|
||||
// Optional. New text of the button in forwarded messages
|
||||
ForwardText string `json:"forward_text,omitempty"`
|
||||
// Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.
|
||||
BotUsername string `json:"bot_username,omitempty"`
|
||||
// Optional. Pass True to request the permission for your bot to send messages to the user.
|
||||
// Optional. Pass True to request the permission for your bot to send messages to the user
|
||||
RequestWriteAccess *bool `json:"request_write_access,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -9083,13 +9083,13 @@ This object represents a message.
|
||||
|
||||
```go
|
||||
type Message struct {
|
||||
// Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
|
||||
// Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent.
|
||||
MessageID int64 `json:"message_id"`
|
||||
// Optional. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only
|
||||
MessageThreadID *int64 `json:"message_thread_id,omitempty"`
|
||||
// Optional. Information about the direct messages chat topic that contains the message
|
||||
DirectMessagesTopic *DirectMessagesTopic `json:"direct_messages_topic,omitempty"`
|
||||
// Optional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats
|
||||
// Optional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats.
|
||||
From *User `json:"from,omitempty"`
|
||||
// Optional. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.
|
||||
SenderChat *Chat `json:"sender_chat,omitempty"`
|
||||
@@ -9155,13 +9155,13 @@ type Message struct {
|
||||
SuggestedPostInfo *SuggestedPostInfo `json:"suggested_post_info,omitempty"`
|
||||
// Optional. Unique identifier of the message effect added to the message
|
||||
EffectID string `json:"effect_id,omitempty"`
|
||||
// Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
|
||||
// Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set.
|
||||
Animation *Animation `json:"animation,omitempty"`
|
||||
// Optional. Message is an audio file, information about the file
|
||||
Audio *Audio `json:"audio,omitempty"`
|
||||
// Optional. Message is a general file, information about the file
|
||||
Document *Document `json:"document,omitempty"`
|
||||
// Optional. Message is a live photo, information about the live photo. For backward compatibility, when this field is set, the photo field will also be set
|
||||
// Optional. Message is a live photo, information about the live photo. For backward compatibility, when this field is set, the photo field will also be set.
|
||||
LivePhoto *LivePhoto `json:"live_photo,omitempty"`
|
||||
// Optional. Message contains paid media; information about the paid media
|
||||
PaidMedia *PaidMediaInfo `json:"paid_media,omitempty"`
|
||||
@@ -9195,7 +9195,7 @@ type Message struct {
|
||||
Game *Game `json:"game,omitempty"`
|
||||
// Optional. Message is a native poll, information about the poll
|
||||
Poll *Poll `json:"poll,omitempty"`
|
||||
// Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
|
||||
// Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set.
|
||||
Venue *Venue `json:"venue,omitempty"`
|
||||
// Optional. Message is a shared location, information about the location
|
||||
Location *Location `json:"location,omitempty"`
|
||||
@@ -9604,7 +9604,7 @@ This object represents one special entity in a text message. For example, hashta
|
||||
|
||||
```go
|
||||
type MessageEntity struct {
|
||||
// Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time)
|
||||
// Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time).
|
||||
Type MessageEntityType `json:"type"`
|
||||
// Offset in UTF-16 code units to the start of the entity
|
||||
Offset int64 `json:"offset"`
|
||||
@@ -9616,7 +9616,7 @@ type MessageEntity struct {
|
||||
User *User `json:"user,omitempty"`
|
||||
// Optional. For “pre” only, the programming language of the entity text
|
||||
Language string `json:"language,omitempty"`
|
||||
// Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker
|
||||
// Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker.
|
||||
CustomEmojiID string `json:"custom_emoji_id,omitempty"`
|
||||
// Optional. For “date_time” only, the Unix time associated with the entity
|
||||
UnixTime *int64 `json:"unix_time,omitempty"`
|
||||
@@ -9668,7 +9668,7 @@ This object represents a unique message identifier.
|
||||
|
||||
```go
|
||||
type MessageId struct {
|
||||
// Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
|
||||
// Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent.
|
||||
MessageID int64 `json:"message_id"`
|
||||
}
|
||||
```
|
||||
@@ -10095,7 +10095,7 @@ type OwnedGiftRegular struct {
|
||||
PrepaidUpgradeStarCount *int64 `json:"prepaid_upgrade_star_count,omitempty"`
|
||||
// Optional. True, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only
|
||||
IsUpgradeSeparate *bool `json:"is_upgrade_separate,omitempty"`
|
||||
// Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift
|
||||
// Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift.
|
||||
UniqueGiftNumber *int64 `json:"unique_gift_number,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -10150,7 +10150,7 @@ type OwnedGiftUnique struct {
|
||||
CanBeTransferred *bool `json:"can_be_transferred,omitempty"`
|
||||
// Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift
|
||||
TransferStarCount *int64 `json:"transfer_star_count,omitempty"`
|
||||
// Optional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now
|
||||
// Optional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now.
|
||||
NextTransferDate *int64 `json:"next_transfer_date,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -10175,7 +10175,7 @@ type OwnedGifts struct {
|
||||
TotalCount int64 `json:"total_count"`
|
||||
// The list of gifts
|
||||
Gifts []OwnedGift `json:"gifts"`
|
||||
// Optional. Offset for the next request. If empty, then there are no more results
|
||||
// Optional. Offset for the next request. If empty, then there are no more results.
|
||||
NextOffset string `json:"next_offset,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -10933,7 +10933,7 @@ type Poll struct {
|
||||
AllowsRevoting bool `json:"allows_revoting"`
|
||||
// True if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours
|
||||
MembersOnly bool `json:"members_only"`
|
||||
// Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll. If omitted, then users from any country can participate in the poll.
|
||||
// Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll. The country code “FT” is used for users with anonymous numbers. If omitted, then users from any country can participate in the poll.
|
||||
CountryCodes []string `json:"country_codes,omitempty"`
|
||||
// Optional. Array of 0-based identifiers of the correct answer options. Available only for polls in quiz mode which are closed or were sent (not forwarded) by the bot or to the private chat with the bot.
|
||||
CorrectOptionIds []int64 `json:"correct_option_ids,omitempty"`
|
||||
@@ -11185,7 +11185,7 @@ Describes an inline message to be sent by a user of a Mini App.
|
||||
type PreparedInlineMessage struct {
|
||||
// Unique identifier of the prepared message
|
||||
ID string `json:"id"`
|
||||
// Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used
|
||||
// Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used.
|
||||
ExpirationDate int64 `json:"expiration_date"`
|
||||
}
|
||||
```
|
||||
@@ -11245,7 +11245,7 @@ type PromoteChatMemberParams struct {
|
||||
CanDeleteMessages *bool `json:"can_delete_messages,omitempty"`
|
||||
// Pass True if the administrator can manage video chats
|
||||
CanManageVideoChats *bool `json:"can_manage_video_chats,omitempty"`
|
||||
// Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators
|
||||
// Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators.
|
||||
CanRestrictMembers *bool `json:"can_restrict_members,omitempty"`
|
||||
// Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)
|
||||
CanPromoteMembers *bool `json:"can_promote_members,omitempty"`
|
||||
@@ -11460,7 +11460,7 @@ The reaction is based on an emoji.
|
||||
type ReactionTypeEmoji struct {
|
||||
// Type of the reaction, always “emoji”
|
||||
Type ReactionTypeKind `json:"type"`
|
||||
// Reaction emoji. Currently, it can be one of "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
|
||||
// Reaction emoji. Currently, it can be one of "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "".
|
||||
Emoji ReactionEmoji `json:"emoji"`
|
||||
}
|
||||
```
|
||||
@@ -11555,7 +11555,7 @@ This object contains basic information about a refunded payment.
|
||||
|
||||
```go
|
||||
type RefundedPayment struct {
|
||||
// Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. Currently, always “XTR”
|
||||
// Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. Currently, always “XTR”.
|
||||
Currency RefundedPaymentCurrency `json:"currency"`
|
||||
// Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
|
||||
TotalAmount int64 `json:"total_amount"`
|
||||
@@ -11824,7 +11824,7 @@ type RestrictChatMemberParams struct {
|
||||
Permissions ChatPermissions `json:"permissions"`
|
||||
// Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.
|
||||
UseIndependentChatPermissions *bool `json:"use_independent_chat_permissions,omitempty"`
|
||||
// Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever
|
||||
// Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever.
|
||||
UntilDate *int64 `json:"until_date,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -11992,7 +11992,7 @@ Stores a keyboard button that can be used by a user within a Mini App. Returns a
|
||||
type SavePreparedKeyboardButtonParams struct {
|
||||
// Unique identifier of the target user that can use the button
|
||||
UserID int64 `json:"user_id"`
|
||||
// A JSON-serialized object describing the button to be saved. The button must be of the type request_users, request_chat, or request_managed_bot
|
||||
// A JSON-serialized object describing the button to be saved. The button must be of the type request_users, request_chat, or request_managed_bot.
|
||||
Button KeyboardButton `json:"button"`
|
||||
}
|
||||
```
|
||||
@@ -12046,7 +12046,7 @@ type SendAnimationParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -12123,7 +12123,7 @@ type SendAudioParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -12166,7 +12166,7 @@ Use this method when you need to tell the user that something is happening on th
|
||||
type SendChatActionParams struct {
|
||||
// Unique identifier of the business connection on behalf of which the action will be sent
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Channel chats and channel direct messages chats aren't supported.
|
||||
// Unique identifier for the target chat or username of the target bot or supergroup in the format @username. Channel chats and channel direct messages chats aren't supported.
|
||||
ChatID ChatID `json:"chat_id"`
|
||||
// Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only
|
||||
MessageThreadID *int64 `json:"message_thread_id,omitempty"`
|
||||
@@ -12240,7 +12240,7 @@ type SendContactParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -12262,7 +12262,7 @@ type SendDiceParams struct {
|
||||
MessageThreadID *int64 `json:"message_thread_id,omitempty"`
|
||||
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
|
||||
DirectMessagesTopicID *int64 `json:"direct_messages_topic_id,omitempty"`
|
||||
// Emoji on which the dice throw animation is based. Currently, must be one of “”, “”, “”, “”, “”, or “”. Dice can have values 1-6 for “”, “” and “”, values 1-5 for “” and “”, and values 1-64 for “”. Defaults to “”
|
||||
// Emoji on which the dice throw animation is based. Currently, must be one of “”, “”, “”, “”, “”, or “”. Dice can have values 1-6 for “”, “” and “”, values 1-5 for “” and “”, and values 1-64 for “”. Defaults to “”.
|
||||
Emoji DiceEmoji `json:"emoji,omitempty"`
|
||||
// Sends the message silently. Users will receive a notification with no sound.
|
||||
DisableNotification *bool `json:"disable_notification,omitempty"`
|
||||
@@ -12276,7 +12276,7 @@ type SendDiceParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -12322,7 +12322,7 @@ type SendDocumentParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -12443,7 +12443,7 @@ type SendInvoiceParams struct {
|
||||
MaxTipAmount *int64 `json:"max_tip_amount,omitempty"`
|
||||
// A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
|
||||
SuggestedTipAmounts []int64 `json:"suggested_tip_amounts,omitempty"`
|
||||
// Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter
|
||||
// Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter.
|
||||
StartParameter string `json:"start_parameter,omitempty"`
|
||||
// JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
|
||||
ProviderData string `json:"provider_data,omitempty"`
|
||||
@@ -12584,7 +12584,7 @@ type SendLocationParams struct {
|
||||
Longitude float64 `json:"longitude"`
|
||||
// The radius of uncertainty for the location, measured in meters; 0-1500
|
||||
HorizontalAccuracy *float64 `json:"horizontal_accuracy,omitempty"`
|
||||
// Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
|
||||
// Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely
|
||||
LivePeriod *int64 `json:"live_period,omitempty"`
|
||||
// For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
|
||||
Heading *int64 `json:"heading,omitempty"`
|
||||
@@ -12602,7 +12602,7 @@ type SendLocationParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -12727,7 +12727,7 @@ type SendMessageParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -12773,7 +12773,7 @@ type SendPaidMediaParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -12846,7 +12846,7 @@ type SendPhotoParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -12895,9 +12895,9 @@ type SendPollParams struct {
|
||||
MessageThreadID *int64 `json:"message_thread_id,omitempty"`
|
||||
// Poll question, 1-300 characters
|
||||
Question string `json:"question"`
|
||||
// Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed
|
||||
// Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed.
|
||||
QuestionParseMode ParseMode `json:"question_parse_mode,omitempty"`
|
||||
// A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode
|
||||
// A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode.
|
||||
QuestionEntities []MessageEntity `json:"question_entities,omitempty"`
|
||||
// A JSON-serialized list of 1-12 answer options
|
||||
Options []InputPollOption `json:"options"`
|
||||
@@ -12917,7 +12917,7 @@ type SendPollParams struct {
|
||||
HideResultsUntilCloses *bool `json:"hide_results_until_closes,omitempty"`
|
||||
// Pass True, if voting is limited to users who have been members of the chat where the poll is being sent for more than 24 hours; for channel chats only
|
||||
MembersOnly *bool `json:"members_only,omitempty"`
|
||||
// A JSON-serialized list of 0-12 two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll; for channel chats only. If omitted or empty, then users from any country can participate in the poll.
|
||||
// A JSON-serialized list of 0-12 two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll; for channel chats only. Use “FT” as a country code to allow users with anonymous numbers to vote. If omitted or empty, then users from any country can participate in the poll.
|
||||
CountryCodes []string `json:"country_codes,omitempty"`
|
||||
// A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, required for polls in quiz mode
|
||||
CorrectOptionIds []int64 `json:"correct_option_ids,omitempty"`
|
||||
@@ -12925,7 +12925,7 @@ type SendPollParams struct {
|
||||
Explanation string `json:"explanation,omitempty"`
|
||||
// Mode for parsing entities in the explanation. See formatting options for more details.
|
||||
ExplanationParseMode ParseMode `json:"explanation_parse_mode,omitempty"`
|
||||
// A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode
|
||||
// A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode.
|
||||
ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"`
|
||||
// Media added to the quiz explanation
|
||||
ExplanationMedia InputPollMedia `json:"explanation_media,omitempty"`
|
||||
@@ -12953,7 +12953,7 @@ type SendPollParams struct {
|
||||
MessageEffectID string `json:"message_effect_id,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -12991,7 +12991,7 @@ type SendStickerParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -13068,7 +13068,7 @@ type SendVenueParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -13090,7 +13090,7 @@ type SendVideoNoteParams struct {
|
||||
MessageThreadID *int64 `json:"message_thread_id,omitempty"`
|
||||
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
|
||||
DirectMessagesTopicID *int64 `json:"direct_messages_topic_id,omitempty"`
|
||||
// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported
|
||||
// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported.
|
||||
VideoNote *InputFile `json:"video_note"`
|
||||
// Duration of sent video in seconds
|
||||
Duration *int64 `json:"duration,omitempty"`
|
||||
@@ -13110,7 +13110,7 @@ type SendVideoNoteParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -13197,7 +13197,7 @@ type SendVideoParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -13268,7 +13268,7 @@ type SendVoiceParams struct {
|
||||
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
||||
// Description of the message to reply to
|
||||
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
|
||||
// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
|
||||
ReplyMarkup any `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -13545,9 +13545,9 @@ Use this method to change the bot's menu button in a private chat, or the defaul
|
||||
|
||||
```go
|
||||
type SetChatMenuButtonParams struct {
|
||||
// Unique identifier for the target private chat. If not specified, default bot's menu button will be changed
|
||||
// Unique identifier for the target private chat. If not specified, the bot's default menu button will be changed.
|
||||
ChatID *int64 `json:"chat_id,omitempty"`
|
||||
// A JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault
|
||||
// A JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault.
|
||||
MenuButton MenuButton `json:"menu_button,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -13656,7 +13656,7 @@ Use this method to set the thumbnail of a custom emoji sticker set. Returns True
|
||||
type SetCustomEmojiStickerSetThumbnailParams struct {
|
||||
// Sticker set name
|
||||
Name string `json:"name"`
|
||||
// Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail.
|
||||
// Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail
|
||||
CustomEmojiID string `json:"custom_emoji_id,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -13674,15 +13674,15 @@ type SetGameScoreParams struct {
|
||||
UserID int64 `json:"user_id"`
|
||||
// New score, must be non-negative
|
||||
Score int64 `json:"score"`
|
||||
// Pass True if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
|
||||
// Pass True if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters.
|
||||
Force *bool `json:"force,omitempty"`
|
||||
// Pass True if the game message should not be automatically edited to include the current scoreboard
|
||||
DisableEditMessage *bool `json:"disable_edit_message,omitempty"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat.
|
||||
ChatID *int64 `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the sent message
|
||||
// Required if inline_message_id is not specified. Identifier of the sent message.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -13738,7 +13738,7 @@ type SetMyCommandsParams struct {
|
||||
Commands []BotCommand `json:"commands"`
|
||||
// A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
|
||||
Scope BotCommandScope `json:"scope,omitempty"`
|
||||
// A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
|
||||
// A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands.
|
||||
LanguageCode string `json:"language_code,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -13991,7 +13991,7 @@ Use this method to specify a URL and receive incoming updates via an outgoing we
|
||||
|
||||
```go
|
||||
type SetWebhookParams struct {
|
||||
// HTTPS URL to send updates to. Use an empty string to remove webhook integration
|
||||
// HTTPS URL to send updates to. Use an empty string to remove webhook integration.
|
||||
URL string `json:"url"`
|
||||
// Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details.
|
||||
Certificate *InputFile `json:"certificate,omitempty"`
|
||||
@@ -14162,9 +14162,9 @@ type StarTransaction struct {
|
||||
NanostarAmount *int64 `json:"nanostar_amount,omitempty"`
|
||||
// Date the transaction was created in Unix time
|
||||
Date int64 `json:"date"`
|
||||
// Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions
|
||||
// Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions.
|
||||
Source TransactionPartner `json:"source,omitempty"`
|
||||
// Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions
|
||||
// Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions.
|
||||
Receiver TransactionPartner `json:"receiver,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -14326,11 +14326,11 @@ type StopMessageLiveLocationParams struct {
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
|
||||
ChatID *ChatID `json:"chat_id,omitempty"`
|
||||
// Required if inline_message_id is not specified. Identifier of the message with live location to stop
|
||||
// Required if inline_message_id is not specified. Identifier of the message with live location to stop.
|
||||
MessageID *int64 `json:"message_id,omitempty"`
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message
|
||||
// Required if chat_id and message_id are not specified. Identifier of the inline message.
|
||||
InlineMessageID string `json:"inline_message_id,omitempty"`
|
||||
// A JSON-serialized object for a new inline keyboard.
|
||||
// A JSON-serialized object for a new inline keyboard
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -14350,7 +14350,7 @@ type StopPollParams struct {
|
||||
ChatID ChatID `json:"chat_id"`
|
||||
// Identifier of the original message with the poll
|
||||
MessageID int64 `json:"message_id"`
|
||||
// A JSON-serialized object for a new message inline keyboard.
|
||||
// A JSON-serialized object for a new message inline keyboard
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -14750,7 +14750,7 @@ Describes a service message about a successful payment for a suggested post.
|
||||
type SuggestedPostPaid struct {
|
||||
// Optional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
|
||||
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"`
|
||||
// Currency in which the payment was made. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins
|
||||
// Currency in which the payment was made. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins.
|
||||
Currency SuggestedPostPaidCurrency `json:"currency"`
|
||||
// Optional. The amount of the currency that was received by the channel in nanotoncoins; for payments in toncoins only
|
||||
Amount *int64 `json:"amount,omitempty"`
|
||||
@@ -14798,7 +14798,7 @@ Describes the price of a suggested post.
|
||||
|
||||
```go
|
||||
type SuggestedPostPrice struct {
|
||||
// Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins
|
||||
// Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins.
|
||||
Currency SuggestedPostPaidCurrency `json:"currency"`
|
||||
// The amount of the currency that will be paid for the post in the smallest units of the currency, i.e. Telegram Stars or nanotoncoins. Currently, price in Telegram Stars must be between 5 and 100000, and price in nanotoncoins must be between 10000000 and 10000000000000.
|
||||
Amount int64 `json:"amount"`
|
||||
@@ -14844,7 +14844,7 @@ This object represents an inline button that switches the current user to inline
|
||||
|
||||
```go
|
||||
type SwitchInlineQueryChosenChat struct {
|
||||
// Optional. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted
|
||||
// Optional. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted.
|
||||
Query string `json:"query,omitempty"`
|
||||
// Optional. True, if private chats with users can be chosen
|
||||
AllowUserChats *bool `json:"allow_user_chats,omitempty"`
|
||||
@@ -15239,7 +15239,7 @@ type UniqueGift struct {
|
||||
GiftID string `json:"gift_id"`
|
||||
// Human-readable name of the regular gift from which this unique gift was upgraded
|
||||
BaseName string `json:"base_name"`
|
||||
// Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas
|
||||
// Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas.
|
||||
Name string `json:"name"`
|
||||
// Unique number of the upgraded gift among gifts upgraded from the same regular gift
|
||||
Number int64 `json:"number"`
|
||||
@@ -15327,7 +15327,7 @@ Describes a service message about a unique gift that was sent or received.
|
||||
type UniqueGiftInfo struct {
|
||||
// Information about the gift
|
||||
Gift UniqueGift `json:"gift"`
|
||||
// Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, “resale” for gifts bought from other users, “gifted_upgrade” for upgrades purchased after the gift was sent, or “offer” for gifts bought or sold through gift purchase offers
|
||||
// Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, “resale” for gifts bought from other users, “gifted_upgrade” for upgrades purchased after the gift was sent, or “offer” for gifts bought or sold through gift purchase offers.
|
||||
Origin UniqueGiftInfoOrigin `json:"origin"`
|
||||
// Optional. For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins.
|
||||
LastResaleCurrency SuggestedPostPaidCurrency `json:"last_resale_currency,omitempty"`
|
||||
@@ -15337,7 +15337,7 @@ type UniqueGiftInfo struct {
|
||||
OwnedGiftID string `json:"owned_gift_id,omitempty"`
|
||||
// Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift
|
||||
TransferStarCount *int64 `json:"transfer_star_count,omitempty"`
|
||||
// Optional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now
|
||||
// Optional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now.
|
||||
NextTransferDate *int64 `json:"next_transfer_date,omitempty"`
|
||||
}
|
||||
```
|
||||
@@ -15516,13 +15516,13 @@ type Update struct {
|
||||
ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"`
|
||||
// Optional. New incoming callback query
|
||||
CallbackQuery *CallbackQuery `json:"callback_query,omitempty"`
|
||||
// Optional. New incoming shipping query. Only for invoices with flexible price
|
||||
// Optional. New incoming shipping query. Only for invoices with flexible price.
|
||||
ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"`
|
||||
// Optional. New incoming pre-checkout query. Contains full information about checkout
|
||||
// Optional. New incoming pre-checkout query. Contains full information about checkout.
|
||||
PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"`
|
||||
// Optional. A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat
|
||||
PurchasedPaidMedia *PaidMediaPurchased `json:"purchased_paid_media,omitempty"`
|
||||
// Optional. New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot
|
||||
// Optional. New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot.
|
||||
Poll *Poll `json:"poll,omitempty"`
|
||||
// Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
|
||||
PollAnswer *PollAnswer `json:"poll_answer,omitempty"`
|
||||
@@ -15811,7 +15811,7 @@ This object contains information about the users whose identifiers were shared w
|
||||
type UsersShared struct {
|
||||
// Identifier of the request
|
||||
RequestID int64 `json:"request_id"`
|
||||
// Information about users shared with the bot.
|
||||
// Information about users shared with the bot
|
||||
Users []SharedUser `json:"users"`
|
||||
}
|
||||
```
|
||||
@@ -15823,7 +15823,7 @@ This object represents a venue.
|
||||
|
||||
```go
|
||||
type Venue struct {
|
||||
// Venue location. Can't be a live location
|
||||
// Venue location. Can't be a live location.
|
||||
Location Location `json:"location"`
|
||||
// Name of the venue
|
||||
Title string `json:"title"`
|
||||
@@ -16065,7 +16065,7 @@ type WebhookInfo struct {
|
||||
LastSynchronizationErrorDate *int64 `json:"last_synchronization_error_date,omitempty"`
|
||||
// Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
|
||||
MaxConnections *int64 `json:"max_connections,omitempty"`
|
||||
// Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member
|
||||
// Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member, message_reaction, and message_reaction_count.
|
||||
AllowedUpdates []UpdateType `json:"allowed_updates,omitempty"`
|
||||
}
|
||||
```
|
||||
|
||||
+117
-13
@@ -19,6 +19,7 @@ Package client provides HTTP client primitives for the Telegram Bot API.
|
||||
- [func \(e \*APIError\) IsRetryable\(\) bool](<#APIError.IsRetryable>)
|
||||
- [func \(e \*APIError\) RetryAfter\(\) time.Duration](<#APIError.RetryAfter>)
|
||||
- [func \(e \*APIError\) Unwrap\(\) error](<#APIError.Unwrap>)
|
||||
- [type BodyEncoder](<#BodyEncoder>)
|
||||
- [type Bot](<#Bot>)
|
||||
- [func New\(token string, opts ...Option\) \*Bot](<#New>)
|
||||
- [func \(b \*Bot\) BaseURL\(\) string](<#Bot.BaseURL>)
|
||||
@@ -29,7 +30,14 @@ Package client provides HTTP client primitives for the Telegram Bot API.
|
||||
- [type Codec](<#Codec>)
|
||||
- [type DefaultCodec](<#DefaultCodec>)
|
||||
- [func \(DefaultCodec\) Marshal\(v any\) \(\[\]byte, error\)](<#DefaultCodec.Marshal>)
|
||||
- [func \(DefaultCodec\) MarshalTo\(w io.Writer, v any\) error](<#DefaultCodec.MarshalTo>)
|
||||
- [func \(DefaultCodec\) Unmarshal\(data \[\]byte, v any\) error](<#DefaultCodec.Unmarshal>)
|
||||
- [type FastHTTPDoer](<#FastHTTPDoer>)
|
||||
- [func NewFastHTTPDoer\(opts ...FastHTTPDoerOption\) \*FastHTTPDoer](<#NewFastHTTPDoer>)
|
||||
- [func \(d \*FastHTTPDoer\) Do\(req \*http.Request\) \(\*http.Response, error\)](<#FastHTTPDoer.Do>)
|
||||
- [type FastHTTPDoerOption](<#FastHTTPDoerOption>)
|
||||
- [func WithFastHTTPClient\(c \*fasthttp.Client\) FastHTTPDoerOption](<#WithFastHTTPClient>)
|
||||
- [func WithFastHTTPReadTimeout\(t time.Duration\) FastHTTPDoerOption](<#WithFastHTTPReadTimeout>)
|
||||
- [type HTTPDoer](<#HTTPDoer>)
|
||||
- [type Logger](<#Logger>)
|
||||
- [type MultipartFile](<#MultipartFile>)
|
||||
@@ -79,8 +87,18 @@ var (
|
||||
)
|
||||
```
|
||||
|
||||
<a name="Version"></a>Version is a fallback version string used only when Go's build info is unavailable \(replace directives, detached \`go run\`\) or has been overridden via linker flags. The authoritative version forwarded to telemetry is resolved at runtime by \[telemetry.SendForModule\] from the build info of whatever binary linked this library, so this constant does NOT need to be bumped on every release. Exposed as a var \(not const\) for ldflag override:
|
||||
|
||||
```
|
||||
go build -ldflags="-X github.com/lukaszraczylo/go-telegram/client.Version=1.2.3"
|
||||
```
|
||||
|
||||
```go
|
||||
var Version = "0.0.0-fallback"
|
||||
```
|
||||
|
||||
<a name="Call"></a>
|
||||
## func [Call](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/call.go#L53>)
|
||||
## func [Call](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/call.go#L68>)
|
||||
|
||||
```go
|
||||
func Call[Req any, Resp any](ctx context.Context, b *Bot, method string, req Req) (Resp, error)
|
||||
@@ -93,7 +111,7 @@ It is generic over both request and response types. Methods with no parameters m
|
||||
Call is exported because the api package \(which lives outside this one\) invokes it from generated method wrappers. User code should not normally call it directly — use the typed wrappers in package api instead.
|
||||
|
||||
<a name="CallRaw"></a>
|
||||
## func [CallRaw](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/call.go#L104>)
|
||||
## func [CallRaw](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/call.go#L119>)
|
||||
|
||||
```go
|
||||
func CallRaw[Req any](ctx context.Context, b *Bot, method string, req Req) (json.RawMessage, error)
|
||||
@@ -166,8 +184,19 @@ func (e *APIError) Unwrap() error
|
||||
|
||||
Unwrap returns the matched sentinel error, if any.
|
||||
|
||||
<a name="BodyEncoder"></a>
|
||||
## type [BodyEncoder](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/codec.go#L24-L26>)
|
||||
|
||||
BodyEncoder is an optional Codec extension that encodes directly into an io.Writer, skipping the intermediate \[\]byte that Marshal returns. Call uses this when present to avoid allocating the marshal result and the bytes.Reader that wraps it; codecs without it fall through to Marshal \+ bytes.NewReader.
|
||||
|
||||
```go
|
||||
type BodyEncoder interface {
|
||||
MarshalTo(w io.Writer, v any) error
|
||||
}
|
||||
```
|
||||
|
||||
<a name="Bot"></a>
|
||||
## type [Bot](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/client.go#L7-L13>)
|
||||
## type [Bot](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/client.go#L11-L24>)
|
||||
|
||||
Bot is the Telegram Bot API client. Construct via New. All API methods \(declared in package api\) hang off \*Bot via thin wrappers around call.
|
||||
|
||||
@@ -178,7 +207,7 @@ type Bot struct {
|
||||
```
|
||||
|
||||
<a name="New"></a>
|
||||
### func [New](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/client.go#L36>)
|
||||
### func [New](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/client.go#L47>)
|
||||
|
||||
```go
|
||||
func New(token string, opts ...Option) *Bot
|
||||
@@ -187,7 +216,7 @@ func New(token string, opts ...Option) *Bot
|
||||
New constructs a Bot with the given token and optional configuration. The default HTTP client is tuned for long\-poll workloads \(see NewDefaultHTTPDoer\); the default codec wraps encoding/json; the default logger discards records.
|
||||
|
||||
<a name="Bot.BaseURL"></a>
|
||||
### func \(\*Bot\) [BaseURL](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/client.go#L20>)
|
||||
### func \(\*Bot\) [BaseURL](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/client.go#L31>)
|
||||
|
||||
```go
|
||||
func (b *Bot) BaseURL() string
|
||||
@@ -196,7 +225,7 @@ func (b *Bot) BaseURL() string
|
||||
BaseURL returns the configured Telegram API base URL.
|
||||
|
||||
<a name="Bot.Codec"></a>
|
||||
### func \(\*Bot\) [Codec](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/client.go#L27>)
|
||||
### func \(\*Bot\) [Codec](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/client.go#L38>)
|
||||
|
||||
```go
|
||||
func (b *Bot) Codec() Codec
|
||||
@@ -205,7 +234,7 @@ func (b *Bot) Codec() Codec
|
||||
Codec returns the configured Codec.
|
||||
|
||||
<a name="Bot.HTTP"></a>
|
||||
### func \(\*Bot\) [HTTP](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/client.go#L24>)
|
||||
### func \(\*Bot\) [HTTP](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/client.go#L35>)
|
||||
|
||||
```go
|
||||
func (b *Bot) HTTP() HTTPDoer
|
||||
@@ -214,7 +243,7 @@ func (b *Bot) HTTP() HTTPDoer
|
||||
HTTP returns the underlying HTTPDoer. Exposed for adapters that need to share connection pools or for diagnostic checks.
|
||||
|
||||
<a name="Bot.Logger"></a>
|
||||
### func \(\*Bot\) [Logger](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/client.go#L30>)
|
||||
### func \(\*Bot\) [Logger](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/client.go#L41>)
|
||||
|
||||
```go
|
||||
func (b *Bot) Logger() Logger
|
||||
@@ -223,7 +252,7 @@ func (b *Bot) Logger() Logger
|
||||
Logger returns the configured Logger.
|
||||
|
||||
<a name="Bot.Token"></a>
|
||||
### func \(\*Bot\) [Token](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/client.go#L17>)
|
||||
### func \(\*Bot\) [Token](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/client.go#L28>)
|
||||
|
||||
```go
|
||||
func (b *Bot) Token() string
|
||||
@@ -232,7 +261,7 @@ func (b *Bot) Token() string
|
||||
Token returns the bot token. Exposed for advanced use cases \(custom transports, manual URL building\); ordinary code does not need it.
|
||||
|
||||
<a name="Codec"></a>
|
||||
## type [Codec](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/codec.go#L10-L13>)
|
||||
## type [Codec](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/codec.go#L14-L17>)
|
||||
|
||||
Codec encodes/decodes JSON payloads exchanged with the Telegram Bot API. The default implementation wraps goccy/go\-json. Users may plug in bytedance/sonic or any compatible encoder by passing WithCodec to New.
|
||||
|
||||
@@ -244,7 +273,7 @@ type Codec interface {
|
||||
```
|
||||
|
||||
<a name="DefaultCodec"></a>
|
||||
## type [DefaultCodec](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/codec.go#L16>)
|
||||
## type [DefaultCodec](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/codec.go#L29>)
|
||||
|
||||
DefaultCodec wraps goccy/go\-json. It is the zero\-value safe default.
|
||||
|
||||
@@ -253,7 +282,7 @@ type DefaultCodec struct{}
|
||||
```
|
||||
|
||||
<a name="DefaultCodec.Marshal"></a>
|
||||
### func \(DefaultCodec\) [Marshal](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/codec.go#L19>)
|
||||
### func \(DefaultCodec\) [Marshal](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/codec.go#L32>)
|
||||
|
||||
```go
|
||||
func (DefaultCodec) Marshal(v any) ([]byte, error)
|
||||
@@ -261,8 +290,17 @@ func (DefaultCodec) Marshal(v any) ([]byte, error)
|
||||
|
||||
Marshal calls json.Marshal.
|
||||
|
||||
<a name="DefaultCodec.MarshalTo"></a>
|
||||
### func \(DefaultCodec\) [MarshalTo](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/codec.go#L40>)
|
||||
|
||||
```go
|
||||
func (DefaultCodec) MarshalTo(w io.Writer, v any) error
|
||||
```
|
||||
|
||||
MarshalTo encodes v into w via goccy/go\-json's streaming encoder. The trailing newline that Encoder appends is valid JSON whitespace and is accepted by Telegram's parser.
|
||||
|
||||
<a name="DefaultCodec.Unmarshal"></a>
|
||||
### func \(DefaultCodec\) [Unmarshal](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/codec.go#L22>)
|
||||
### func \(DefaultCodec\) [Unmarshal](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/codec.go#L35>)
|
||||
|
||||
```go
|
||||
func (DefaultCodec) Unmarshal(data []byte, v any) error
|
||||
@@ -270,6 +308,72 @@ func (DefaultCodec) Unmarshal(data []byte, v any) error
|
||||
|
||||
Unmarshal calls json.Unmarshal.
|
||||
|
||||
<a name="FastHTTPDoer"></a>
|
||||
## type [FastHTTPDoer](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/fasthttp_doer.go#L26-L32>)
|
||||
|
||||
FastHTTPDoer is an HTTPDoer backed by github.com/valyala/fasthttp. It trades net/http compatibility \(and HTTP/2 support\) for substantially fewer allocations per request — fasthttp pools its Request and Response objects and uses a zero\-allocation HTTP/1.1 parser.
|
||||
|
||||
Use it for high\-throughput bots when GC pressure matters and you don't need HTTP/2 or any net/http\-only middleware \(RoundTripper composition, the OpenTelemetry httptrace family, etc.\):
|
||||
|
||||
```
|
||||
bot := client.New(token, client.WithHTTPClient(client.NewFastHTTPDoer()))
|
||||
```
|
||||
|
||||
Wrap with RetryDoer the same way you would the default doer.
|
||||
|
||||
```go
|
||||
type FastHTTPDoer struct {
|
||||
// contains filtered or unexported fields
|
||||
}
|
||||
```
|
||||
|
||||
<a name="NewFastHTTPDoer"></a>
|
||||
### func [NewFastHTTPDoer](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/fasthttp_doer.go#L52>)
|
||||
|
||||
```go
|
||||
func NewFastHTTPDoer(opts ...FastHTTPDoerOption) *FastHTTPDoer
|
||||
```
|
||||
|
||||
NewFastHTTPDoer constructs a FastHTTPDoer with sensible defaults.
|
||||
|
||||
<a name="FastHTTPDoer.Do"></a>
|
||||
### func \(\*FastHTTPDoer\) [Do](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/fasthttp_doer.go#L75>)
|
||||
|
||||
```go
|
||||
func (d *FastHTTPDoer) Do(req *http.Request) (*http.Response, error)
|
||||
```
|
||||
|
||||
Do satisfies HTTPDoer by translating req into a pooled fasthttp.Request, dispatching it, and returning a \*http.Response whose Body releases the pooled fasthttp.Response when Close is called.
|
||||
|
||||
The conversion is intentionally minimal: URL goes via req.URL.RequestURI\(\) \+ Host \(avoids re\-parsing\), header values move byte\-for\-byte, and the body is taken straight from req.Body. \*bytes.Buffer / \*bytes.Reader are recognised so we can pass the underlying bytes without io.ReadAll.
|
||||
|
||||
<a name="FastHTTPDoerOption"></a>
|
||||
## type [FastHTTPDoerOption](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/fasthttp_doer.go#L35>)
|
||||
|
||||
FastHTTPDoerOption configures a FastHTTPDoer.
|
||||
|
||||
```go
|
||||
type FastHTTPDoerOption func(*FastHTTPDoer)
|
||||
```
|
||||
|
||||
<a name="WithFastHTTPClient"></a>
|
||||
### func [WithFastHTTPClient](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/fasthttp_doer.go#L40>)
|
||||
|
||||
```go
|
||||
func WithFastHTTPClient(c *fasthttp.Client) FastHTTPDoerOption
|
||||
```
|
||||
|
||||
WithFastHTTPClient swaps in a pre\-configured \*fasthttp.Client. Useful for sharing a connection pool across multiple bots or applying custom dial / TLS configuration.
|
||||
|
||||
<a name="WithFastHTTPReadTimeout"></a>
|
||||
### func [WithFastHTTPReadTimeout](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/fasthttp_doer.go#L47>)
|
||||
|
||||
```go
|
||||
func WithFastHTTPReadTimeout(t time.Duration) FastHTTPDoerOption
|
||||
```
|
||||
|
||||
WithFastHTTPReadTimeout sets the per\-request fallback timeout used when the inbound context has no deadline. Long\-poll callers should pass a value larger than the long\-poll timeout.
|
||||
|
||||
<a name="HTTPDoer"></a>
|
||||
## type [HTTPDoer](<https://github.com/lukaszraczylo/go-telegram/blob/main/client/httpclient.go#L13-L15>)
|
||||
|
||||
|
||||
@@ -4,13 +4,18 @@ go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/goccy/go-json v0.10.6
|
||||
github.com/lukaszraczylo/oss-telemetry v0.2.1
|
||||
github.com/stretchr/testify v1.9.0
|
||||
golang.org/x/net v0.54.0
|
||||
github.com/valyala/fasthttp v1.71.0
|
||||
golang.org/x/net v0.55.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/andybalholm/brotli v1.2.1 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/klauspost/compress v1.18.6 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/stretchr/objx v0.5.2 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
@@ -1,15 +1,27 @@
|
||||
github.com/andybalholm/brotli v1.2.1 h1:R+f5xP285VArJDRgowrfb9DqL18yVK0gKAW/F+eTWro=
|
||||
github.com/andybalholm/brotli v1.2.1/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU=
|
||||
github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao=
|
||||
github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
|
||||
github.com/lukaszraczylo/oss-telemetry v0.2.1 h1:6ULyfzXplpdmIY/i01OPM1jeod9+L1RAhI0jtbVnJI0=
|
||||
github.com/lukaszraczylo/oss-telemetry v0.2.1/go.mod h1:+Cn78qZo8rc3T9eZt0v3oICYRdd75wORtSidc8lNjDQ=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w=
|
||||
golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ=
|
||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
github.com/valyala/fasthttp v1.71.0 h1:tepR7H+Guh9VUqxxcPggYi8R3lGUu2Rsdh+z7/FCY3k=
|
||||
github.com/valyala/fasthttp v1.71.0/go.mod h1:z1sDUvOShhXq/C9mwH/fSm1Vb71tUJwmQdgkBrBNwnA=
|
||||
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
|
||||
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
|
||||
golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8=
|
||||
golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
|
||||
+140
-140
File diff suppressed because it is too large
Load Diff
@@ -28,7 +28,8 @@ import (
|
||||
// Telegram-format token (digits:[\w-]{35}). telego enforces this format on construction.
|
||||
const benchToken = "1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ_ab123456"
|
||||
|
||||
// BenchmarkCall_ours — lukaszraczylo/go-telegram.
|
||||
// BenchmarkCall_ours — lukaszraczylo/go-telegram with default net/http
|
||||
// transport. Most users land here.
|
||||
func BenchmarkCall_ours(b *testing.B) {
|
||||
srv := shared.NewMockServer()
|
||||
defer srv.Close()
|
||||
@@ -47,6 +48,30 @@ func BenchmarkCall_ours(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
// BenchmarkCall_ours_fasthttp — lukaszraczylo/go-telegram with the
|
||||
// opt-in fasthttp transport (client.NewFastHTTPDoer). Apples-to-apples
|
||||
// against telego, which also runs on fasthttp by default.
|
||||
func BenchmarkCall_ours_fasthttp(b *testing.B) {
|
||||
srv := shared.NewMockServer()
|
||||
defer srv.Close()
|
||||
bot := client.New(benchToken,
|
||||
client.WithBaseURL(srv.URL),
|
||||
client.WithHTTPClient(client.NewFastHTTPDoer()),
|
||||
)
|
||||
ctx := context.Background()
|
||||
b.ReportAllocs()
|
||||
b.ResetTimer()
|
||||
for b.Loop() {
|
||||
_, err := api.SendMessage(ctx, bot, &api.SendMessageParams{
|
||||
ChatID: api.ChatIDFromInt(42),
|
||||
Text: "hello",
|
||||
})
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// BenchmarkCall_gotba — go-telegram-bot-api/telegram-bot-api/v5.
|
||||
func BenchmarkCall_gotba(b *testing.B) {
|
||||
srv := shared.NewMockServer()
|
||||
|
||||
@@ -14,20 +14,20 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/andybalholm/brotli v1.2.0 // indirect
|
||||
github.com/andybalholm/brotli v1.2.1 // indirect
|
||||
github.com/bytedance/gopkg v0.1.3 // indirect
|
||||
github.com/bytedance/sonic v1.15.0 // indirect
|
||||
github.com/bytedance/sonic/loader v0.5.0 // indirect
|
||||
github.com/cloudwego/base64x v0.1.6 // indirect
|
||||
github.com/goccy/go-json v0.10.6 // indirect
|
||||
github.com/grbit/go-json v0.11.0 // indirect
|
||||
github.com/klauspost/compress v1.18.2 // indirect
|
||||
github.com/klauspost/compress v1.18.6 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasthttp v1.69.0 // indirect
|
||||
github.com/valyala/fasthttp v1.71.0 // indirect
|
||||
github.com/valyala/fastjson v1.6.10 // indirect
|
||||
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
|
||||
golang.org/x/sys v0.39.0 // indirect
|
||||
golang.org/x/sys v0.41.0 // indirect
|
||||
golang.org/x/time v0.5.0 // indirect
|
||||
)
|
||||
|
||||
@@ -65,8 +65,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
|
||||
github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
|
||||
github.com/andybalholm/brotli v1.2.1 h1:R+f5xP285VArJDRgowrfb9DqL18yVK0gKAW/F+eTWro=
|
||||
github.com/andybalholm/brotli v1.2.1/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
|
||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||
@@ -275,8 +275,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V
|
||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.18.2 h1:iiPHWW0YrcFgpBYhsA6D1+fqHssJscY/Tm/y2Uqnapk=
|
||||
github.com/klauspost/compress v1.18.2/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
|
||||
github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao=
|
||||
github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
|
||||
github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY=
|
||||
github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
@@ -392,8 +392,8 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
github.com/valyala/fasthttp v1.69.0 h1:fNLLESD2SooWeh2cidsuFtOcrEi4uB4m1mPrkJMZyVI=
|
||||
github.com/valyala/fasthttp v1.69.0/go.mod h1:4wA4PfAraPlAsJ5jMSqCE2ug5tqUPwKXxVj8oNECGcw=
|
||||
github.com/valyala/fasthttp v1.71.0 h1:tepR7H+Guh9VUqxxcPggYi8R3lGUu2Rsdh+z7/FCY3k=
|
||||
github.com/valyala/fasthttp v1.71.0/go.mod h1:z1sDUvOShhXq/C9mwH/fSm1Vb71tUJwmQdgkBrBNwnA=
|
||||
github.com/valyala/fastjson v1.6.10 h1:/yjJg8jaVQdYR3arGxPE2X5z89xrlhS0eGXdv+ADTh4=
|
||||
github.com/valyala/fastjson v1.6.10/go.mod h1:e6FubmQouUNP73jtMLmcbxS6ydWIpOfhz34TSfO3JaE=
|
||||
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
|
||||
@@ -624,8 +624,8 @@ golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
|
||||
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
|
||||
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
|
||||
@@ -4,55 +4,55 @@ pkg: github.com/lukaszraczylo/go-telegram/test/benchmarks
|
||||
cpu: Apple M4 Max
|
||||
│ /Users/nvm/Documents/projects/private/go-telegram/test/benchmarks/results/raw.txt │
|
||||
│ sec/op │
|
||||
Call_ours-16 38.95µ ± 3%
|
||||
Call_gotba-16 41.95µ ± 2%
|
||||
Call_telebot-16 43.63µ ± 0%
|
||||
Call_gobot-16 61.11µ ± 1%
|
||||
Call_telego-16 36.31µ ± 1%
|
||||
Dispatch_ours-16 100.7n ± 3%
|
||||
Dispatch_telebot-16 269.2n ± 5%
|
||||
Dispatch_gobot-16 251.5n ± 4%
|
||||
LargeUnmarshal_ours-16 6.667µ ± 4%
|
||||
LargeUnmarshal_gotba-16 8.321µ ± 2%
|
||||
LargeUnmarshal_telebot-16 10.24µ ± 4%
|
||||
LargeUnmarshal_gobot-16 8.150µ ± 2%
|
||||
LargeUnmarshal_telego-16 7.797µ ± 1%
|
||||
LargeUnmarshal_echotron-16 8.072µ ± 0%
|
||||
Webhook_ours-16 1.743µ ± 3%
|
||||
Webhook_gotba-16 2.016µ ± 3%
|
||||
Webhook_telebot-16 2.073µ ± 3%
|
||||
Webhook_gobot-16 1.999µ ± 1%
|
||||
Webhook_telego-16 2.026µ ± 2%
|
||||
Webhook_echotron-16 1.973µ ± 0%
|
||||
geomean 4.603µ
|
||||
Call_ours-16 39.83µ ± 4%
|
||||
Call_gotba-16 42.03µ ± 4%
|
||||
Call_telebot-16 43.41µ ± 1%
|
||||
Call_gobot-16 61.19µ ± 1%
|
||||
Call_telego-16 35.84µ ± 1%
|
||||
Dispatch_ours-16 98.46n ± 2%
|
||||
Dispatch_telebot-16 270.9n ± 2%
|
||||
Dispatch_gobot-16 246.1n ± 1%
|
||||
LargeUnmarshal_ours-16 6.726µ ± 1%
|
||||
LargeUnmarshal_gotba-16 8.066µ ± 1%
|
||||
LargeUnmarshal_telebot-16 10.19µ ± 1%
|
||||
LargeUnmarshal_gobot-16 8.231µ ± 1%
|
||||
LargeUnmarshal_telego-16 7.849µ ± 2%
|
||||
LargeUnmarshal_echotron-16 8.123µ ± 1%
|
||||
Webhook_ours-16 1.832µ ± 4%
|
||||
Webhook_gotba-16 2.082µ ± 0%
|
||||
Webhook_telebot-16 2.194µ ± 1%
|
||||
Webhook_gobot-16 2.082µ ± 1%
|
||||
Webhook_telego-16 2.143µ ± 2%
|
||||
Webhook_echotron-16 2.039µ ± 1%
|
||||
geomean 4.658µ
|
||||
|
||||
│ /Users/nvm/Documents/projects/private/go-telegram/test/benchmarks/results/raw.txt │
|
||||
│ B/op │
|
||||
Call_ours-16 11.17Ki ± 0%
|
||||
Call_gotba-16 10.95Ki ± 0%
|
||||
Call_telebot-16 13.16Ki ± 0%
|
||||
Call_gobot-16 13.51Ki ± 0%
|
||||
Call_telego-16 6.556Ki ± 0%
|
||||
Call_ours-16 11.09Ki ± 1%
|
||||
Call_gotba-16 10.97Ki ± 0%
|
||||
Call_telebot-16 13.15Ki ± 0%
|
||||
Call_gobot-16 13.50Ki ± 0%
|
||||
Call_telego-16 6.547Ki ± 0%
|
||||
Dispatch_ours-16 128.0 ± 0%
|
||||
Dispatch_telebot-16 678.0 ± 0%
|
||||
Dispatch_telebot-16 678.5 ± 0%
|
||||
Dispatch_gobot-16 48.00 ± 0%
|
||||
LargeUnmarshal_ours-16 5.881Ki ± 0%
|
||||
LargeUnmarshal_ours-16 5.875Ki ± 0%
|
||||
LargeUnmarshal_gotba-16 3.438Ki ± 0%
|
||||
LargeUnmarshal_telebot-16 5.594Ki ± 0%
|
||||
LargeUnmarshal_gobot-16 4.703Ki ± 0%
|
||||
LargeUnmarshal_telego-16 6.621Ki ± 0%
|
||||
LargeUnmarshal_telego-16 6.600Ki ± 0%
|
||||
LargeUnmarshal_echotron-16 4.219Ki ± 0%
|
||||
Webhook_ours-16 2.180Ki ± 0%
|
||||
Webhook_gotba-16 1.461Ki ± 0%
|
||||
Webhook_telebot-16 1.773Ki ± 0%
|
||||
Webhook_gobot-16 1.789Ki ± 0%
|
||||
Webhook_telego-16 3.060Ki ± 0%
|
||||
Webhook_telego-16 3.058Ki ± 0%
|
||||
Webhook_echotron-16 1.680Ki ± 0%
|
||||
geomean 2.701Ki
|
||||
geomean 2.699Ki
|
||||
|
||||
│ /Users/nvm/Documents/projects/private/go-telegram/test/benchmarks/results/raw.txt │
|
||||
│ allocs/op │
|
||||
Call_ours-16 104.0 ± 0%
|
||||
Call_ours-16 102.0 ± 0%
|
||||
Call_gotba-16 125.0 ± 0%
|
||||
Call_telebot-16 139.0 ± 0%
|
||||
Call_gobot-16 176.0 ± 0%
|
||||
@@ -72,4 +72,4 @@ Webhook_telebot-16
|
||||
Webhook_gobot-16 16.00 ± 0%
|
||||
Webhook_telego-16 11.00 ± 0%
|
||||
Webhook_echotron-16 16.00 ± 0%
|
||||
geomean 26.03
|
||||
geomean 26.00
|
||||
|
||||
+201
-202
@@ -2,206 +2,205 @@ goos: darwin
|
||||
goarch: arm64
|
||||
pkg: github.com/lukaszraczylo/go-telegram/test/benchmarks
|
||||
cpu: Apple M4 Max
|
||||
BenchmarkCall_ours-16 30754 38732 ns/op 11589 B/op 105 allocs/op
|
||||
BenchmarkCall_ours-16 31054 39002 ns/op 11476 B/op 104 allocs/op
|
||||
BenchmarkCall_ours-16 30990 38440 ns/op 11471 B/op 104 allocs/op
|
||||
BenchmarkCall_ours-16 30301 39464 ns/op 11452 B/op 104 allocs/op
|
||||
BenchmarkCall_ours-16 30438 38897 ns/op 11425 B/op 104 allocs/op
|
||||
BenchmarkCall_ours-16 30783 39107 ns/op 11429 B/op 104 allocs/op
|
||||
BenchmarkCall_ours-16 30486 39507 ns/op 11402 B/op 104 allocs/op
|
||||
BenchmarkCall_ours-16 30045 37723 ns/op 11442 B/op 104 allocs/op
|
||||
BenchmarkCall_ours-16 37867 33103 ns/op 11444 B/op 104 allocs/op
|
||||
BenchmarkCall_ours-16 30522 39139 ns/op 11436 B/op 104 allocs/op
|
||||
BenchmarkCall_gotba-16 29838 40947 ns/op 11243 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 28545 41897 ns/op 11182 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 28713 41146 ns/op 11197 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 28480 42210 ns/op 11238 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 28831 42004 ns/op 11204 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 28484 42012 ns/op 11224 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 30481 41283 ns/op 11212 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 28646 42042 ns/op 11209 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 28418 40680 ns/op 11250 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 28358 42146 ns/op 11208 B/op 125 allocs/op
|
||||
BenchmarkCall_telebot-16 27294 43739 ns/op 13522 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27763 43429 ns/op 13491 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27525 43618 ns/op 13478 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27423 43711 ns/op 13431 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27415 43704 ns/op 13473 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27268 43834 ns/op 13477 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 28180 43488 ns/op 13486 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27480 43644 ns/op 13485 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27458 43581 ns/op 13479 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27949 43415 ns/op 13480 B/op 139 allocs/op
|
||||
BenchmarkCall_gobot-16 19503 60924 ns/op 13847 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19620 61253 ns/op 13837 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19790 60869 ns/op 13839 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19574 61153 ns/op 13816 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19634 61070 ns/op 13830 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19569 61173 ns/op 13817 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19549 61688 ns/op 13851 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19918 60815 ns/op 13779 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19440 61667 ns/op 13830 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19660 61036 ns/op 13837 B/op 176 allocs/op
|
||||
BenchmarkCall_telego-16 32732 36606 ns/op 6788 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 33837 35882 ns/op 6697 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 33074 36146 ns/op 6693 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 33400 36090 ns/op 6723 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 32684 36296 ns/op 6709 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 32926 36577 ns/op 6721 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 33928 35481 ns/op 6708 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 33195 36318 ns/op 6711 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 33140 36812 ns/op 6717 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 32343 37631 ns/op 6716 B/op 48 allocs/op
|
||||
BenchmarkDispatch_ours-16 12199088 98.57 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 12223122 97.66 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 12088142 97.43 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 12463010 100.9 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 12284848 99.38 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 11485198 101.1 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 11685897 102.2 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 11733669 102.1 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 11811807 100.5 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 11691974 103.1 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4270724 284.6 ns/op 679 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4369950 270.2 ns/op 678 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4604205 269.9 ns/op 679 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4431572 282.2 ns/op 678 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4186550 272.0 ns/op 678 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4472223 265.7 ns/op 679 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4537406 265.0 ns/op 679 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4544478 264.4 ns/op 678 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4519431 266.7 ns/op 678 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4448779 268.5 ns/op 678 B/op 5 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4493029 254.1 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4726080 261.5 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4884592 249.6 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4639986 256.7 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4424702 261.1 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4783779 249.2 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4916862 248.2 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4884650 249.9 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4822939 252.4 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4707606 250.5 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 177442 6697 ns/op 6024 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 178348 6700 ns/op 6021 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 180528 6686 ns/op 6022 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 182416 6659 ns/op 6021 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 179305 6675 ns/op 6022 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 176892 6724 ns/op 6021 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 185355 6392 ns/op 6022 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 189590 6390 ns/op 6022 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 189783 6438 ns/op 6022 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 187572 6483 ns/op 6022 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 142377 8296 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 144884 8274 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 146434 8295 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 145183 8260 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 144775 8416 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 139510 8224 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 146359 8542 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 144981 8346 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 146877 8399 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 145443 8454 ns/op 3519 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 116883 10327 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 114584 10333 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 117277 10250 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 117700 10270 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 117328 10401 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 115922 10223 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 117475 10049 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 123367 9866 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 123385 9811 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 122586 9873 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 148576 8064 ns/op 4817 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 147967 8113 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 150718 7991 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 150271 8066 ns/op 4815 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 147646 8066 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 147889 8186 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 143164 8413 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 150464 8276 ns/op 4815 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 145249 8201 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 146100 8216 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 149001 7802 ns/op 6781 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 152780 7835 ns/op 6775 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 156508 7817 ns/op 6780 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 154938 7816 ns/op 6777 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 150121 7809 ns/op 6778 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 152810 7791 ns/op 6780 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 159613 7784 ns/op 6778 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 154402 7729 ns/op 6780 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 157184 7660 ns/op 6782 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 155822 7768 ns/op 6780 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 144252 8147 ns/op 4323 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 147961 8089 ns/op 4319 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 149847 8049 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 149128 8069 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 147277 8075 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 149132 8089 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 148837 8014 ns/op 4319 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 149288 8050 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 146833 8097 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 149233 8041 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkWebhook_ours-16 707102 1721 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 700047 1734 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 725071 1721 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 675003 1751 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 693903 1787 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 714036 1751 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 646494 1816 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 696355 1801 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 709545 1734 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 709700 1725 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_gotba-16 611132 2027 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 624046 2072 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 588478 2093 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 609744 2012 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 606912 2012 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 612211 2000 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 605488 2015 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 622398 2006 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 610478 2017 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 610350 2030 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 559515 2138 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 558510 2057 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 587257 2079 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 585321 2059 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 576236 2067 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 570172 2070 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 568270 2131 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 567567 2094 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 586588 2076 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 574495 2062 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gobot-16 597710 2006 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 594742 2016 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 603187 1998 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 608301 2011 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 605532 1984 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 609892 1990 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 596637 1999 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 592108 1993 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 607069 1999 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 594915 1997 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_telego-16 603300 2021 ns/op 3133 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 602503 2016 ns/op 3133 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 618267 2016 ns/op 3133 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 601855 2027 ns/op 3133 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 612424 2035 ns/op 3132 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 595890 2074 ns/op 3133 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 605565 2001 ns/op 3133 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 610453 2096 ns/op 3133 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 588056 2069 ns/op 3132 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 595764 2025 ns/op 3133 B/op 11 allocs/op
|
||||
BenchmarkWebhook_echotron-16 599088 1975 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 626964 1975 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 635306 1967 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 606621 1965 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 625998 1965 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 646352 1976 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 634186 1971 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 628503 1982 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 612586 1975 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 622320 1965 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkCall_ours-16 27756 39971 ns/op 11497 B/op 103 allocs/op
|
||||
BenchmarkCall_ours-16 30495 39111 ns/op 11329 B/op 102 allocs/op
|
||||
BenchmarkCall_ours-16 29250 41427 ns/op 11356 B/op 102 allocs/op
|
||||
BenchmarkCall_ours-16 29766 39680 ns/op 11366 B/op 102 allocs/op
|
||||
BenchmarkCall_ours-16 29157 40066 ns/op 11338 B/op 102 allocs/op
|
||||
BenchmarkCall_ours-16 30567 38404 ns/op 11276 B/op 102 allocs/op
|
||||
BenchmarkCall_ours-16 30470 38923 ns/op 11306 B/op 102 allocs/op
|
||||
BenchmarkCall_ours-16 30520 40212 ns/op 11364 B/op 102 allocs/op
|
||||
BenchmarkCall_ours-16 30315 39595 ns/op 11361 B/op 102 allocs/op
|
||||
BenchmarkCall_ours-16 28747 41549 ns/op 11434 B/op 102 allocs/op
|
||||
BenchmarkCall_gotba-16 28140 43735 ns/op 11255 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 27189 43528 ns/op 11247 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 27940 43644 ns/op 11259 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 29090 41643 ns/op 11232 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 28002 42461 ns/op 11183 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 28578 42082 ns/op 11204 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 28549 41973 ns/op 11237 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 29086 41702 ns/op 11203 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 29630 41783 ns/op 11262 B/op 125 allocs/op
|
||||
BenchmarkCall_gotba-16 28371 41810 ns/op 11217 B/op 125 allocs/op
|
||||
BenchmarkCall_telebot-16 27510 43416 ns/op 13457 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 28102 43319 ns/op 13473 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27558 43530 ns/op 13417 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27274 43654 ns/op 13445 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27627 43530 ns/op 13489 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27499 42836 ns/op 13467 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27860 43375 ns/op 13457 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27711 43400 ns/op 13439 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 27668 43472 ns/op 13482 B/op 139 allocs/op
|
||||
BenchmarkCall_telebot-16 28063 43182 ns/op 13487 B/op 139 allocs/op
|
||||
BenchmarkCall_gobot-16 19645 60805 ns/op 13879 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19562 61374 ns/op 13823 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19575 60944 ns/op 13823 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19538 61461 ns/op 13844 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19624 61253 ns/op 13806 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19617 61127 ns/op 13824 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19516 61568 ns/op 13775 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19514 61340 ns/op 13828 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 19392 60426 ns/op 13863 B/op 176 allocs/op
|
||||
BenchmarkCall_gobot-16 23968 49951 ns/op 13844 B/op 176 allocs/op
|
||||
BenchmarkCall_telego-16 33622 35493 ns/op 6780 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 33874 35438 ns/op 6703 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 34560 35482 ns/op 6704 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 33298 35830 ns/op 6711 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 33205 35946 ns/op 6706 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 33428 35949 ns/op 6707 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 33452 35974 ns/op 6692 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 33056 35853 ns/op 6705 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 33120 35808 ns/op 6703 B/op 48 allocs/op
|
||||
BenchmarkCall_telego-16 33450 38996 ns/op 6699 B/op 48 allocs/op
|
||||
BenchmarkDispatch_ours-16 12381547 96.05 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 12636062 99.34 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 12161170 98.43 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 12205023 97.90 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 12590581 98.83 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 12033376 99.15 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 12049588 98.48 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 12324108 98.38 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 11924947 96.71 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_ours-16 11940064 99.26 ns/op 128 B/op 3 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4456072 262.5 ns/op 678 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4330234 275.3 ns/op 678 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4478779 268.7 ns/op 679 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4394821 282.5 ns/op 678 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4376773 271.6 ns/op 679 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4516370 268.7 ns/op 678 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4465942 276.0 ns/op 678 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4399328 270.1 ns/op 679 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4531597 268.3 ns/op 679 B/op 5 allocs/op
|
||||
BenchmarkDispatch_telebot-16 4376616 272.3 ns/op 679 B/op 5 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4911369 249.4 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4896456 246.3 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4789376 246.4 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4949206 247.7 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4902912 243.1 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4913300 244.7 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4925991 245.5 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4817457 245.9 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4943328 245.8 ns/op 49 B/op 1 allocs/op
|
||||
BenchmarkDispatch_gobot-16 4751266 248.1 ns/op 48 B/op 1 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 180361 6682 ns/op 6019 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 178388 6765 ns/op 6016 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 182600 6701 ns/op 6016 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 178785 6710 ns/op 6016 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 181588 6726 ns/op 6016 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 177378 6730 ns/op 6016 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 181004 6729 ns/op 6016 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 176672 6682 ns/op 6016 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 184182 6726 ns/op 6016 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_ours-16 179983 6813 ns/op 6016 B/op 34 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 138108 8579 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 148593 8143 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 147964 8075 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 147601 8161 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 148257 8020 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 150858 8058 ns/op 3519 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 149251 8040 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 151614 8054 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 152306 8050 ns/op 3519 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_gotba-16 152979 8094 ns/op 3520 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 119103 10113 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 115418 10247 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 116160 10260 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 117031 10346 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 116731 10311 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 121227 10135 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 119989 10178 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 119311 10194 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 119388 10183 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_telebot-16 120195 10133 ns/op 5728 B/op 60 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 146700 8235 ns/op 4817 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 147666 8230 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 148058 8212 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 148092 8210 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 146656 8208 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 148036 8259 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 146211 8287 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 146793 8279 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 146083 8232 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_gobot-16 147385 8221 ns/op 4816 B/op 50 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 150852 8155 ns/op 6762 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 152559 8040 ns/op 6758 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 146462 7989 ns/op 6757 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 154480 7842 ns/op 6759 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 155208 7811 ns/op 6759 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 149310 7848 ns/op 6759 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 156939 7835 ns/op 6757 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 154064 7867 ns/op 6759 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 153975 7849 ns/op 6758 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_telego-16 152520 7811 ns/op 6758 B/op 31 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 145399 8167 ns/op 4323 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 147351 8124 ns/op 4319 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 148053 8094 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 147170 8124 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 147792 8092 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 145971 8105 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 148708 8122 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 147525 8105 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 148635 8165 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkLargeUnmarshal_echotron-16 150871 8124 ns/op 4320 B/op 56 allocs/op
|
||||
BenchmarkWebhook_ours-16 705109 1911 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 651456 1911 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 683557 1875 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 668317 1830 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 703718 1833 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 707150 1844 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 700472 1810 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 699192 1828 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 671794 1828 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_ours-16 687226 1826 ns/op 2232 B/op 11 allocs/op
|
||||
BenchmarkWebhook_gotba-16 544628 2080 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 565494 2081 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 579736 2081 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 581365 2082 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 580501 2075 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 582160 2091 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 563130 2089 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 573872 2088 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 569616 2093 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gotba-16 599923 2069 ns/op 1496 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 562394 2162 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 562137 2272 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 488323 2220 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 538561 2199 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 581037 2187 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 540055 2213 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 546921 2203 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 574988 2188 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 588076 2154 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_telebot-16 571617 2181 ns/op 1816 B/op 17 allocs/op
|
||||
BenchmarkWebhook_gobot-16 588786 2080 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 551653 2080 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 590686 2084 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 588870 2096 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 606735 2064 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 597108 2084 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 600633 2069 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 589102 2110 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 583528 2104 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_gobot-16 599022 2073 ns/op 1832 B/op 16 allocs/op
|
||||
BenchmarkWebhook_telego-16 587408 2193 ns/op 3131 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 601533 2152 ns/op 3131 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 584689 2127 ns/op 3131 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 576732 2153 ns/op 3131 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 568095 2143 ns/op 3131 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 553896 2132 ns/op 3131 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 579055 2130 ns/op 3131 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 595776 2144 ns/op 3131 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 573843 2134 ns/op 3131 B/op 11 allocs/op
|
||||
BenchmarkWebhook_telego-16 513824 2267 ns/op 3131 B/op 11 allocs/op
|
||||
BenchmarkWebhook_echotron-16 587734 2178 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 557188 2039 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 600524 2020 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 602959 2019 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 588694 2048 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 602366 2039 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 604621 2031 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 599146 2037 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 586056 2051 ns/op 1720 B/op 16 allocs/op
|
||||
BenchmarkWebhook_echotron-16 598456 2049 ns/op 1720 B/op 16 allocs/op
|
||||
PASS
|
||||
ok github.com/lukaszraczylo/go-telegram/test/benchmarks 241.963s
|
||||
? github.com/lukaszraczylo/go-telegram/test/benchmarks/shared [no test files]
|
||||
ok github.com/lukaszraczylo/go-telegram/test/benchmarks 242.858s
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
snapshot_2026-05-08.html
|
||||
snapshot_2026-06-01.html
|
||||
+19872
File diff suppressed because one or more lines are too long
+19872
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user