Cleaner no title
This commit is contained in:
parent
2570726524
commit
459a0462f7
7
app.py
7
app.py
|
@ -18,9 +18,12 @@ 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')
|
||||||
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'
|
return 'ok'
|
||||||
|
|
||||||
webserver = uvicorn.Server(
|
webserver = uvicorn.Server(
|
||||||
|
|
Loading…
Reference in New Issue