mirror of
https://github.com/catspace-dev/unicheckbot.git
synced 2024-11-21 21:46:32 +03:00
Better split without space
This commit is contained in:
parent
4501018078
commit
8c49d3f0b6
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -17,7 +17,7 @@ class WriteCommandMetric(BaseMiddleware):
|
|||
value=1,
|
||||
),
|
||||
tags=dict(
|
||||
command=message.text.split(" ")[0],
|
||||
command=message.text.split()[0],
|
||||
type="command"
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user