all repos — telegram-bot-api @ 309f2dd87fd1a17c552d9ae11a983ff28fc4afdf

Golang bindings for the Telegram Bot API

Minor code quality improvements.
Syfaro syfaro@huefox.com
Mon, 26 Mar 2018 11:54:02 -0500
commit

309f2dd87fd1a17c552d9ae11a983ff28fc4afdf

parent

102c3104f489ae065a67884747d2d7fedf790e42

2 files changed, 12 insertions(+), 5 deletions(-)

jump to
M bot_test.gobot_test.go

@@ -373,7 +373,10 @@ func TestSendWithNewStickerAndKeyboardHide(t *testing.T) {

bot, _ := getBot(t) msg := tgbotapi.NewStickerUpload(ChatID, "tests/image.jpg") - msg.ReplyMarkup = tgbotapi.ReplyKeyboardRemove{true, false} + msg.ReplyMarkup = tgbotapi.ReplyKeyboardRemove{ + RemoveKeyboard: true, + Selective: false, + } _, err := bot.Send(msg) if err != nil {

@@ -386,7 +389,10 @@ func TestSendWithExistingStickerAndKeyboardHide(t *testing.T) {

bot, _ := getBot(t) msg := tgbotapi.NewStickerShare(ChatID, ExistingStickerFileID) - msg.ReplyMarkup = tgbotapi.ReplyKeyboardRemove{true, false} + msg.ReplyMarkup = tgbotapi.ReplyKeyboardRemove{ + RemoveKeyboard: true, + Selective: false, + } _, err := bot.Send(msg)

@@ -399,7 +405,7 @@

func TestGetFile(t *testing.T) { bot, _ := getBot(t) - file := tgbotapi.FileConfig{ExistingPhotoFileID} + file := tgbotapi.FileConfig{FileID: ExistingPhotoFileID} _, err := bot.GetFile(file)
M types.gotypes.go

@@ -232,9 +232,9 @@ // IsCommand() checks that the message begins with a bot_command entity

entity := (*m.Entities)[0] if len(m.Text) == entity.Length { return "" // The command makes up the whole message - } else { - return m.Text[entity.Length+1:] } + + return m.Text[entity.Length+1:] } // MessageEntity contains information about data in a Message.

@@ -772,6 +772,7 @@ ShippingOptionID string `json:"shipping_option_id,omitempty"`

OrderInfo *OrderInfo `json:"order_info,omitempty"` } +// Error is an error containing extra information returned by the Telegram API. type Error struct { Message string ResponseParameters