mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 20:35:24 +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)
|
||||
}
|
||||
|
||||
_, 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 {
|
||||
t.log("Can't send telegram alert!")
|
||||
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