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

7
app.py
View File

@ -18,9 +18,12 @@ async def main():
@app.route("/push", methods = ["POST"])
async def push():
title = request.form.get('title', 'No title')
title = request.form.get('title', None)
body = request.form.get('body', 'No body')
await bot.send_message(chat, text = '<b>' + title + '</b>\n\n' + body, parse_mode = 'html')
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')
return 'ok'
webserver = uvicorn.Server(