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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for telegram-error-alerter-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a93e0a67da873cd1f1355c150caa47c92dafc5b4f0dfd2aa9e050844e80e9a8 |
|
MD5 | a1d9931b08dd3b6eeae482b54c2e038f |
|
BLAKE2b-256 | 5937da6ac4f3c85146725989d98370d1ef6908a8c2d43036d9f1b5b077751927 |
Close
Hashes for telegram_error_alerter-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf7d7f22c9a5d80dc07bc2d56b2a1119aa262c1eefff2ca722d19cb7ea1fae89 |
|
MD5 | 59e8cd231f0cda183bfc1c59b519065e |
|
BLAKE2b-256 | fb0013b6c4c4b1dfbd60e4630ea6690173bf528b286cda89d74f97347382652f |