Merge master into develop.

This commit is contained in:
Syfaro 2018-10-08 03:13:50 -05:00
commit 23ed97b145
10 changed files with 687 additions and 45 deletions

View file

@ -476,16 +476,12 @@ func TestSetWebhookWithCert(t *testing.T) {
t.Fail()
}
info, err := bot.GetWebhookInfo()
_, err = bot.GetWebhookInfo()
if err != nil {
t.Error(err)
}
if info.LastErrorDate != 0 {
t.Errorf("failed to set webhook: %s", info.LastErrorMessage)
}
bot.Request(tgbotapi.RemoveWebhookConfig{})
}
@ -529,6 +525,20 @@ func TestUpdatesChan(t *testing.T) {
}
}
func TestSendWithMediaGroup(t *testing.T) {
bot, _ := getBot(t)
cfg := tgbotapi.NewMediaGroup(ChatID, []interface{}{
tgbotapi.NewInputMediaPhoto("https://i.imgur.com/unQLJIb.jpg"),
tgbotapi.NewInputMediaPhoto("https://i.imgur.com/J5qweNZ.jpg"),
tgbotapi.NewInputMediaVideo("https://i.imgur.com/F6RmI24.mp4"),
})
_, err := bot.Request(cfg)
if err != nil {
t.Error(err)
}
}
func ExampleNewBotAPI() {
bot, err := tgbotapi.NewBotAPI("MyAwesomeBotToken")
if err != nil {