Maintainer-telegram-bot is simple but useful assistant, that notify you about new GitHub
releases (GitLab
, BitBucket
, etc. will be added later).
git clone https://github.com/sund3RRR/maintainer-bot.git
cd maintainer-bot
python -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt
Don't forget to set your tokens in environment variables.
githubToken=<TOKEN> tgToken=<TOKEN> python src/run.py
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