File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/main/kotlin/me/devoxin/flight/internal/arguments Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -99,8 +99,10 @@ class Argument(
9999 }
100100 OptionType .CHANNEL -> mapping.asChannel
101101 OptionType .ROLE -> mapping.asRole
102- OptionType .NUMBER -> mapping.asDouble
103- OptionType .ATTACHMENT -> mapping.asAttachment
102+ OptionType .NUMBER -> when (type) {
103+ Float ::class .java, java.lang.Float ::class .java -> mapping.asDouble.toFloat()
104+ else -> mapping.asDouble
105+ }
104106 else -> throw IllegalStateException (" Unsupported OptionType ${mapping.type.name} " )
105107 }
106108
@@ -179,6 +181,8 @@ class Argument(
179181
180182 Double ::class .java to OptionType .NUMBER ,
181183 java.lang.Double ::class .java to OptionType .NUMBER ,
184+ Float ::class .java to OptionType .NUMBER ,
185+ java.lang.Float ::class .java to OptionType .NUMBER ,
182186
183187 Boolean ::class .java to OptionType .BOOLEAN ,
184188 java.lang.Boolean ::class .java to OptionType .BOOLEAN ,
You can’t perform that action at this time.
0 commit comments