Skip to content

UrNickName16/Telexception

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A Python module to handle exceptions and send alerts via Telegram

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages