refactor: functools.partial -> lamdba
This commit is contained in:
parent
e032d04157
commit
32817f735e
@ -1,4 +1,3 @@
|
|||||||
import functools
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import arguments
|
import arguments
|
||||||
@ -14,7 +13,7 @@ async def clear(message):
|
|||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"count",
|
"count",
|
||||||
type=functools.partial(arguments.range_type, min=1, max=1000),
|
type=lambda c: arguments.range_type(c, min=1, max=1000),
|
||||||
help="amount of messages to delete",
|
help="amount of messages to delete",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import functools
|
|
||||||
|
|
||||||
import arguments
|
import arguments
|
||||||
import commands
|
import commands
|
||||||
import utils
|
import utils
|
||||||
@ -25,7 +23,7 @@ async def queue_or_play(message):
|
|||||||
"-v",
|
"-v",
|
||||||
"--volume",
|
"--volume",
|
||||||
default=50,
|
default=50,
|
||||||
type=functools.partial(arguments.range_type, min=0, max=150),
|
type=lambda v: arguments.range_type(v, min=0, max=150),
|
||||||
help="the volume level (0 - 150)",
|
help="the volume level (0 - 150)",
|
||||||
)
|
)
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
@ -226,7 +224,7 @@ async def volume(message):
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"volume",
|
"volume",
|
||||||
nargs="?",
|
nargs="?",
|
||||||
type=functools.partial(arguments.range_type, min=0, max=150),
|
type=lambda v: arguments.range_type(v, min=0, max=150),
|
||||||
help="the volume level (0 - 150)",
|
help="the volume level (0 - 150)",
|
||||||
)
|
)
|
||||||
if not (args := await parser.parse_args(message, tokens)):
|
if not (args := await parser.parse_args(message, tokens)):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user