From bd1aa7e6ef60fd302ed84e1990fb4dbb791f73af Mon Sep 17 00:00:00 2001 From: Zaur Abdulgalimov Date: Thu, 9 Nov 2017 18:41:22 +0300 Subject: [PATCH 1/2] User:IsBot & RestrictChatMember:UntilDate --- bot.go | 3 +++ types.go | 1 + 2 files changed, 4 insertions(+) diff --git a/bot.go b/bot.go index 41e9b27..030612f 100644 --- a/bot.go +++ b/bot.go @@ -739,6 +739,9 @@ func (bot *BotAPI) RestrictChatMember(config RestrictChatMemberConfig) (APIRespo if &config.CanAddWebPagePreviews != nil { v.Add("can_add_web_page_previews", strconv.FormatBool(*config.CanAddWebPagePreviews)) } + if config.UntilDate != 0 { + v.Add("until_date", strconv.FormatInt(config.UntilDate, 10)) + } bot.debugLog("restrictChatMember", v, nil) diff --git a/types.go b/types.go index 91875bb..bef68b8 100644 --- a/types.go +++ b/types.go @@ -56,6 +56,7 @@ type User struct { LastName string `json:"last_name"` // optional UserName string `json:"username"` // optional LanguageCode string `json:"language_code"` // optional + IsBot bool `json:"is_bot"` // optional } // String displays a simple text version of a user. From 5dbfec17f3f32cc28060221a35a9af6d93739b8a Mon Sep 17 00:00:00 2001 From: Zaur Abdulgalimov Date: Thu, 9 Nov 2017 19:46:11 +0300 Subject: [PATCH 2/2] test User:IsBot --- types_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types_test.go b/types_test.go index 9ef03b1..62089c4 100644 --- a/types_test.go +++ b/types_test.go @@ -8,7 +8,7 @@ import ( ) func TestUserStringWith(t *testing.T) { - user := tgbotapi.User{0, "Test", "Test", "", "en"} + user := tgbotapi.User{0, "Test", "Test", "", "en", false} if user.String() != "Test Test" { t.Fail()