Skip to content

Commit

Permalink
Change field Thumb type (#13)
Browse files Browse the repository at this point in the history
* change Thumb fields to InputFile

* change Thumb fields to InputFile

* fix test
  • Loading branch information
negasus authored Jan 30, 2023
1 parent 9018b38 commit 37b2614
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.4.2 (2023-01-30)

- [BUGFIX] change field Thumb to InputFile type

## v0.4.1 (2023-01-19)

- add func `EscapeMarkdownUnescaped` for escape only unescaped symbols
Expand Down
10 changes: 5 additions & 5 deletions methods_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type SendAudioParams struct {
Duration int `json:"duration,omitempty"`
Performer string `json:"performer,omitempty"`
Title string `json:"title,omitempty"`
Thumb string `json:"thumb,omitempty"`
Thumb models.InputFile `json:"thumb,omitempty"`
DisableNotification bool `json:"disable_notification,omitempty"`
ProtectContent bool `json:"protect_content,omitempty"`
ReplyToMessageID int `json:"reply_to_message_id,omitempty"`
Expand All @@ -93,7 +93,7 @@ type SendDocumentParams struct {
ChatID any `json:"chat_id"`
MessageThreadID int `json:"message_thread_id,omitempty"`
Document models.InputFile `json:"document"`
Thumb string `json:"thumb,omitempty"`
Thumb models.InputFile `json:"thumb,omitempty"`
Caption string `json:"caption,omitempty"`
ParseMode models.ParseMode `json:"parse_mode,omitempty"`
CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"`
Expand All @@ -112,7 +112,7 @@ type SendVideoParams struct {
Duration int `json:"duration,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
Thumb string `json:"thumb,omitempty"`
Thumb models.InputFile `json:"thumb,omitempty"`
Caption string `json:"caption,omitempty"`
ParseMode models.ParseMode `json:"parse_mode,omitempty"`
CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"`
Expand All @@ -132,7 +132,7 @@ type SendAnimationParams struct {
Duration int `json:"duration,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
Thumb string `json:"thumb,omitempty"`
Thumb models.InputFile `json:"thumb,omitempty"`
Caption string `json:"caption,omitempty"`
ParseMode models.ParseMode `json:"parse_mode,omitempty"`
CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"`
Expand Down Expand Up @@ -165,7 +165,7 @@ type SendVideoNoteParams struct {
VideoNote models.InputFile `json:"video_note"`
Duration int `json:"duration,omitempty"`
Length int `json:"length,omitempty"`
Thumb string `json:"thumb,omitempty"`
Thumb models.InputFile `json:"thumb,omitempty"`
DisableNotification bool `json:"disable_notification,omitempty"`
ProtectContent bool `json:"protect_content,omitempty"`
ReplyToMessageID int `json:"reply_to_message_id,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions methods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ func TestBot_Methods(t *testing.T) {

t.Run("SendVideoNote", func(t *testing.T) {
c := &httpClient{t: t, resp: `{"text":"bar"}`, reqFields: map[string]string{
"thumb": "foo",
"thumb": `{"Data":"foo"}`,
}}
b := &Bot{client: c}
resp, err := b.SendVideoNote(context.Background(), &SendVideoNoteParams{
Thumb: "foo",
Thumb: models.InputFileString{Data: "foo"},
})
assertNoErr(t, err)
assertEqualString(t, "bar", resp.Text)
Expand Down

0 comments on commit 37b2614

Please sign in to comment.