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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file telegram-error-alerter-1.0.1.tar.gz.

File metadata

  • Download URL: telegram-error-alerter-1.0.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for telegram-error-alerter-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8a93e0a67da873cd1f1355c150caa47c92dafc5b4f0dfd2aa9e050844e80e9a8
MD5 a1d9931b08dd3b6eeae482b54c2e038f
BLAKE2b-256 5937da6ac4f3c85146725989d98370d1ef6908a8c2d43036d9f1b5b077751927

See more details on using hashes here.

File details

Details for the file telegram_error_alerter-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for telegram_error_alerter-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf7d7f22c9a5d80dc07bc2d56b2a1119aa262c1eefff2ca722d19cb7ea1fae89
MD5 59e8cd231f0cda183bfc1c59b519065e
BLAKE2b-256 fb0013b6c4c4b1dfbd60e4630ea6690173bf528b286cda89d74f97347382652f

See more details on using hashes here.

Supported by

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