mirror of
https://github.com/evilhero/mylar
synced 2024-12-22 07:42:24 +00:00
fallback to default text notification in case of errors
This commit is contained in:
parent
7f44f4a278
commit
563439acdf
1 changed files with 6 additions and 3 deletions
|
@ -357,13 +357,16 @@ class TELEGRAM:
|
|||
logger.info('Telegram notify failed: ' + str(e))
|
||||
|
||||
# Error logging
|
||||
sent_successfuly = True
|
||||
sent_successfully = True
|
||||
if not response.status_code == 200:
|
||||
logger.info(u'Could not send notification to TelegramBot (token=%s). Response: [%s]' % (self.token, response.text))
|
||||
sent_successfuly = False
|
||||
sent_successfully = False
|
||||
|
||||
if not sent_successfully and sendMethod != "sendMessage":
|
||||
return self.notify(message)
|
||||
|
||||
logger.info(u"Telegram notifications sent.")
|
||||
return sent_successfuly
|
||||
return sent_successfully
|
||||
|
||||
def test_notify(self):
|
||||
return self.notify('Test Message: Release the Ninjas!')
|
||||
|
|
Loading…
Reference in a new issue