/maintainer-python-bot

Telegram bot that helps keep track of new releases

Primary LanguagePython

Maintainer-bot

Maintainer-telegram-bot is simple but useful assistant, that notify you about new GitHub releases (GitLab, BitBucket, etc. will be added later).

image

Setup

Clone git repository

git clone https://github.com/sund3RRR/maintainer-bot.git
cd maintainer-bot

Setup python

python -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt

Run

Don't forget to set your tokens in environment variables.

githubToken=<TOKEN> tgToken=<TOKEN> python src/run.py

Info

Bot uses an exception wrapper, which is set via excepthook to catch unhandled exceptions and write them to the log/ directory.

def log_exception(exc_type, exc_value, exc_traceback):
    logging.error("Uncaught exception",
                  exc_info=(exc_type, exc_value, exc_traceback))
    tb = ''.join(traceback.format_exception(exc_type, exc_value, exc_traceback))

    dt = datetime.datetime.now().strftime(r"%Y-%m-%d-%H:%M")
    with open(f"log/exception-{dt}.log", "w") as f:
        f.write(tb)

sys.excepthook = log_exception

Media

image add_repo list_repos