mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Fix minimum and maximum being casted to str in Range[str, ...]
This commit is contained in:
parent
9c109ae59b
commit
0b1c5df3e0
@ -492,10 +492,15 @@ else:
|
||||
else:
|
||||
raise TypeError(f'expected int, float, or str as range type, received {obj_type!r} instead')
|
||||
|
||||
if obj_type in (str, int):
|
||||
cast = int
|
||||
else:
|
||||
cast = float
|
||||
|
||||
transformer = _make_range_transformer(
|
||||
opt_type,
|
||||
min=obj_type(min) if min is not None else None,
|
||||
max=obj_type(max) if max is not None else None,
|
||||
min=cast(min) if min is not None else None,
|
||||
max=cast(max) if max is not None else None,
|
||||
)
|
||||
return _TransformMetadata(transformer)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user