Skip to main content

Send error to telegram group via bot

Project description

import Alerter

tg_alert = Alerter(bot_token=’YOUR_BOT_TOKEN’, chat_id=’YOUR_CHAT_ID’) #or tg_alert = Alerter.from_environment() #Recommend

method_1: tg_alert.send_message(chat_id=111222333, text=’Message text’) #or method_2: as decorator @tg_alert def some_func_that_can_raise_an_exception(): raise RuntimeError(‘this is an exception’)

We could use in except scope as:
except Exception as e:

return tg_alert.custom_alert(text=e)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telegram-error-alerter-1.0.1.tar.gz (7.1 kB view hashes)

Uploaded Source

Built Distribution

telegram_error_alerter-1.0.1-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page