mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-27 02:52:14 +01:00
add response code check for telegram
This commit is contained in:
parent
d95491d05d
commit
ffa4d70037
@ -92,11 +92,15 @@ func (t *task) sendTelegramAlert() {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = http.Post("https://api.telegram.org/bot"+util.Config.TelegramToken+"/sendMessage", "application/json", &telegramBuffer)
|
resp, err := http.Post("https://api.telegram.org/bot"+util.Config.TelegramToken+"/sendMessage", "application/json", &telegramBuffer)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.log("Can't send telegram alert!")
|
t.log("Can't send telegram alert!")
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if resp.StatusCode != 200 {
|
||||||
|
t.log("Can't send telegram alert! Response code not 200!")
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user