Merge branch 'abdulgalimov-bugfix'

bot-api-6.1
zhuharev 2017-11-09 21:45:36 +03:00
commit 87b8e431a9
3 changed files with 5 additions and 1 deletions

3
bot.go
View File

@ -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)

View File

@ -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.

View File

@ -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()