Skip to main content

A Python module that sends exception messages to Telegram

Project description

Telexception

Python GitHub last commit License

Telexception is a Python module that helps track raised exceptions in your code. When an exception is raised, Telexception sends a message to a specified Telegram chat.

Features

  • Sends automatic notifications to Telegram when exceptions are raised
  • Can send traceback and log files for more detailed troubleshooting
  • Easy to integrate into existing Python projects

Installation

You can install Telexception using pip:

pip install telexception

Usage

  • Create telegram bot via @BotFather and get API_KEY

  • Get user_id (you can find other telegram bots who can provide this information like @userinfobot)

  • initialize the bot with your API key and user ID:

bot = Telexception("api_key", "user_id")

Also you can send traceback or log file:

bot = Telexception("api_key", "user_id", send_traceback=True, path_to_logs='path/to/logs.log')

Then, use the exception_handler decorator on any function you want to track:

@bot.exception_handler
def some_function_with_problems(*args, **kwargs):
    pass

When some_function_with_problems raises an exception, a message will be sent to the specified Telegram chat.

License

This project is licensed under the terms of the MIT license.

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

telexception-1.0.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

telexception-1.0.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file telexception-1.0.0.tar.gz.

File metadata

  • Download URL: telexception-1.0.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for telexception-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2a519d923b03be56bbac43f52bab6bdd5a68acb8baa049aeedb5c74ab204cc41
MD5 87b0802e849d98bfc6bc6b85bc88851a
BLAKE2b-256 4625c68207219c0ac9170e173afad1f82243c401dae4ca4e28b4773e7e529cba

See more details on using hashes here.

File details

Details for the file telexception-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: telexception-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for telexception-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cbe3a84ad016df9ba697c6634c89a1d357f351ab33b8bbe2aaa75cdc556daaa2
MD5 15de8e795735df8e2e7304167f696968
BLAKE2b-256 e3742109befb145ff85cabe76678830156922aa24b9d242b5962432c564c0c04

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