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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: telexception-0.1.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-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3cf784fb5c640035a88ea0c0895f6344af57d8c2854d9547f6dd38f910744000
MD5 df39c46eebef26dfcae6c0a7b587f73c
BLAKE2b-256 b663e0ae3bf7d12adf81afa24df850b0a9fc6a72fa084ea515a4d49594e54ddb

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