From 5fcb5b890006455beac303fa29a7e32d08e523cb Mon Sep 17 00:00:00 2001 From: mihalin Date: Tue, 28 Sep 2021 01:43:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=20=D0=B2?= =?UTF-8?q?=20=D1=80=D0=B5=D0=B6=D0=B8=D0=BC=D0=B5=20=D0=BE=D1=82=D0=BB?= =?UTF-8?q?=D0=B0=D0=B4=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 311a625..b2f26e4 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ import asyncio +import argparse from tortoise import Tortoise from olgram.router import dp @@ -43,11 +44,17 @@ def main(): """ Classic polling """ + parser = argparse.ArgumentParser("Olgram server") + parser.add_argument("--noserver", help="Не запускать сервер обратной связи, только сам Olgram (режим для " + "разработки)", action="store_true") + args = parser.parse_args() + loop = asyncio.get_event_loop() loop.run_until_complete(initialization()) loop.create_task(dp.start_polling()) - loop.create_task(server_main().start()) + if not args.noserver: + loop.create_task(server_main().start()) loop.run_forever()