diff --git a/app.py b/app.py index 5774292..56a2c52 100644 --- a/app.py +++ b/app.py @@ -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 = '' + title + '\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 = '' + title + '\n\n' + body, parse_mode = 'html') return 'ok' webserver = uvicorn.Server(