Merge master into develop.
This commit is contained in:
commit
6a6de7e674
6 changed files with 170 additions and 44 deletions
32
bot_test.go
32
bot_test.go
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue