refactor: functools.partial -> lamdba
This commit is contained in:
		| @@ -1,4 +1,3 @@ | ||||
| import functools | ||||
| import re | ||||
|  | ||||
| import arguments | ||||
| @@ -14,7 +13,7 @@ async def clear(message): | ||||
|     ) | ||||
|     parser.add_argument( | ||||
|         "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", | ||||
|     ) | ||||
|     parser.add_argument( | ||||
|   | ||||
| @@ -1,5 +1,3 @@ | ||||
| import functools | ||||
|  | ||||
| import arguments | ||||
| import commands | ||||
| import utils | ||||
| @@ -25,7 +23,7 @@ async def queue_or_play(message): | ||||
|         "-v", | ||||
|         "--volume", | ||||
|         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)", | ||||
|     ) | ||||
|     group.add_argument( | ||||
| @@ -226,7 +224,7 @@ async def volume(message): | ||||
|     parser.add_argument( | ||||
|         "volume", | ||||
|         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)", | ||||
|     ) | ||||
|     if not (args := await parser.parse_args(message, tokens)): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user