mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-24 03:54:20 +00:00
Add github-telegram hook
This commit is contained in:
parent
0a07740bca
commit
1fbdd979f8
1 changed files with 14 additions and 0 deletions
14
webserver.py
14
webserver.py
|
@ -402,6 +402,20 @@ def ses_identify():
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/hooks/github")
|
||||||
|
def hooks_github():
|
||||||
|
try:
|
||||||
|
j = request.get_json()
|
||||||
|
except Exception:
|
||||||
|
abort(400)
|
||||||
|
return
|
||||||
|
message = f"🐙 {j['size']} aggiornamenti a Royalnet ricevuti:\n"
|
||||||
|
for commit in j.get("commits", []):
|
||||||
|
message += f"<b>{commit['message']}</b> di {commit['author']}\n"
|
||||||
|
telegram_bot.send_message(config["Telegram"]["main_group"],
|
||||||
|
parse_mode="HTML", disable_web_page_preview=True, disable_notification=True)
|
||||||
|
|
||||||
|
|
||||||
@app.before_request
|
@app.before_request
|
||||||
def pre_request():
|
def pre_request():
|
||||||
fl_g.css = "nryg.less"
|
fl_g.css = "nryg.less"
|
||||||
|
|
Loading…
Reference in a new issue