Merge master into develop.
This commit is contained in:
commit
23ed97b145
10 changed files with 687 additions and 45 deletions
20
bot_test.go
20
bot_test.go
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue