From fc607cee5c39b8dc5b2db651028b218c15ef45e6 Mon Sep 17 00:00:00 2001 From: mihalin Date: Sat, 19 Feb 2022 05:53:53 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=20=D0=B1?= =?UTF-8?q?=D0=B5=D0=B7=20olgram=20=D0=B8=20=D0=B1=D0=B5=D0=B7=20=D1=81?= =?UTF-8?q?=D0=B5=D1=80=D0=B2=D0=B5=D1=80=D0=B0=20(=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D1=85=D0=BE=D0=B4=20=D0=BD=D0=B0=20=D0=B4=D0=B2=D0=B0=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=82=D0=B5=D0=B9=D0=BD=D0=B5=D1=80=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/source/index.rst | 1 + main.py | 13 ++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index c2c3bd9..7d25997 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -15,6 +15,7 @@ about quick_start templates + threads developer additional diff --git a/main.py b/main.py index e33eeeb..d5402e2 100644 --- a/main.py +++ b/main.py @@ -41,18 +41,17 @@ async def initialization(): def main(): - """ - Classic polling - """ - parser = argparse.ArgumentParser("Olgram server") - parser.add_argument("--noserver", help="Не запускать сервер обратной связи, только сам Olgram (режим для " - "разработки)", action="store_true") + parser = argparse.ArgumentParser("Olgram bot and feedback server") + group = parser.add_mutually_exclusive_group() + group.add_argument("--noserver", help="Не запускать сервер обратной связи, только сам Olgram", action="store_true") + group.add_argument("--onlyserver", help="Запустить только сервер обратной связи, без Olgram") args = parser.parse_args() loop = asyncio.get_event_loop() loop.run_until_complete(initialization()) - loop.create_task(dp.start_polling()) + if not args.onlyserver: + loop.create_task(dp.start_polling()) if not args.noserver: loop.create_task(server_main().start())