Merge master into develop.

This commit is contained in:
Syfaro 2018-03-26 12:22:16 -05:00
commit 6a6de7e674
6 changed files with 170 additions and 44 deletions

View file

@ -476,6 +476,16 @@ func TestSetWebhookWithCert(t *testing.T) {
t.Fail()
}
info, 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{})
}
@ -493,6 +503,16 @@ func TestSetWebhookWithoutCert(t *testing.T) {
t.Fail()
}
info, 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{})
}
@ -558,6 +578,16 @@ func ExampleNewWebhook() {
log.Fatal(err)
}
info, err := bot.GetWebhookInfo()
if err != nil {
log.Fatal(err)
}
if info.LastErrorDate != 0 {
log.Printf("failed to set webhook: %s", info.LastErrorMessage)
}
updates := bot.ListenForWebhook("/" + bot.Token)
go http.ListenAndServeTLS("0.0.0.0:8443", "cert.pem", "key.pem", nil)
@ -566,7 +596,7 @@ func ExampleNewWebhook() {
}
}
func ExampleAnswerInlineQuery() {
func ExampleInlineConfig() {
bot, err := tgbotapi.NewBotAPI("MyAwesomeBotToken") // create new bot
if err != nil {
log.Panic(err)