Remora.Discord
Remora.Discord copied to clipboard
Fix validation for MinValue and MaxValue attributes
closes #234
Added some tests and fixed the bug I found. While working on this I also noticed that the min and max value attributes can't be applied to integers, should this be changed?
Can you elaborate more on "min and max value attributes can't be applied to integers" please
Can you elaborate more on "min and max value attributes can't be applied to integers" please
I could just be completely missing something, but it seems like the attributes only take ulongs, longs, floats, or doubles as parameters. It took me until right about now that that probably doesn't matter since that's seperate to how parameters are parsed for commands.
Technically it does support integers as well, as its value will be implicitly casted to long or ulong. Same would also count for float and double.
Maybe @Nihlus could elaborate why the attribute uses the types in the OneOf. Related line: https://github.com/Remora/Remora.Discord/blob/main/Remora.Discord.Commands/Attributes/MinValueAttribute.cs#L39