Merge pull request #21 from cmd410/main

Better split without space
This commit is contained in:
kiriharu 2021-01-13 20:36:25 +03:00 committed by GitHub
commit 1bbe0ade62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 6 deletions

View File

@ -110,7 +110,7 @@ class CheckerBaseHandler(SimpleCommandHandler):
def process_args_for_host_port(text: str, default_port: int) -> list:
port = None
args = text.split(" ")
args = text.split()
if len(args) < 2:
raise NotEnoughArgs()
if len(args) == 2:

View File

@ -31,7 +31,7 @@ class ICMPCheckerHandler(CheckerBaseHandler):
await self.check(message.chat.id, message.bot, dict(target=args[0], target_fq=args[0]))
async def process_args(self, text: str) -> list:
args = text.split(" ")
args = text.split()
if len(args) == 1:
raise NotEnoughArgs()
if len(args) >= 2:

View File

@ -35,7 +35,7 @@ class IPCalcCommandHandler(SimpleCommandHandler):
await message.answer(msg)
async def process_args(self, text: str) -> list:
args = text.split(" ")
args = text.split()
if len(args) == 1:
raise NotEnoughArgs
return args

View File

@ -30,7 +30,7 @@ class TCPCheckerHandler(CheckerBaseHandler):
async def process_args(self, text: str) -> list:
port = None
args = text.split(" ")
args = text.split()
if len(args) < 3:
raise NotEnoughArgs()
if len(args) >= 3:

View File

@ -82,7 +82,7 @@ def create_whois_message(domain: str) -> str:
@rate_limit
async def whois_cmd(msg: Message):
args = msg.text.split(" ")
args = msg.text.split()
if len(args) == 1:
return await msg.answer(no_domain_text)
if len(args) >= 2:

View File

@ -17,7 +17,7 @@ class WriteCommandMetric(BaseMiddleware):
value=1,
),
tags=dict(
command=message.text.split(" ")[0],
command=message.text.split()[0],
type="command"
)
)