fix (send cmd): Harden arg parsing.

Fix an issue where the send arg parsing would pass non-matching input.
This commit is contained in:
2021-10-24 20:12:28 +03:00
parent 9b8c952e78
commit 5ad4ec5ee1

View File

@@ -26,7 +26,7 @@ async def cmd_send(ctx):
# Extract target and amount # Extract target and amount
# Handle a slightly more flexible input than stated # Handle a slightly more flexible input than stated
splits = ctx.args.split() splits = ctx.args.split()
digits = [split.isdigit() for split in splits] digits = [split.isdigit() for split in splits[:2]]
mentions = ctx.msg.mentions mentions = ctx.msg.mentions
if len(splits) < 2 or not any(digits) or not (all(digits) or mentions): if len(splits) < 2 or not any(digits) or not (all(digits) or mentions):
return await _send_usage(ctx) return await _send_usage(ctx)