Cleaner no title

This commit is contained in:
Thomas Forgione 2024-02-23 16:45:25 +01:00
parent 2570726524
commit 459a0462f7
1 changed files with 5 additions and 2 deletions

5
app.py
View File

@ -18,8 +18,11 @@ async def main():
@app.route("/push", methods = ["POST"]) @app.route("/push", methods = ["POST"])
async def push(): async def push():
title = request.form.get('title', 'No title') title = request.form.get('title', None)
body = request.form.get('body', 'No body') body = request.form.get('body', 'No body')
if title is None:
await bot.send_message(chat, text = body, parse_mode = 'html')
else:
await bot.send_message(chat, text = '<b>' + title + '</b>\n\n' + body, parse_mode = 'html') await bot.send_message(chat, text = '<b>' + title + '</b>\n\n' + body, parse_mode = 'html')
return 'ok' return 'ok'