Support the Number application command option type
@@ -98,7 +98,10 @@ class OptionType(int, enums.Enum):
"""Denotes a command option where the value will be a string."""
INTEGER = 4
- """Denotes a command option where the value will be a int."""
+ """Denotes a command option where the value will be a int.
+
+ This is range limited between -2^53 and 2^53.
+ """
BOOLEAN = 5
"""Denotes a command option where the value will be a bool."""
@@ -115,6 +118,12 @@ class OptionType(int, enums.Enum):
MENTIONABLE = 9
"""Denotes a command option where the value will be a snowflake ID."""
+ FLOAT = 10
+ """Denotes a command option where the value will be a float.
+
+ This is range limited between -2^53 and 2^53.
+ """
+
@attr_extensions.with_copy
@attr.define(hash=False, kw_only=True, weakref_slot=False)
@@ -124,7 +133,7 @@ class CommandChoice:
name: str = attr.field(repr=True)
"""The choice's name (inclusively between 1-100 characters)."""
- value: typing.Union[str, int] = attr.field(repr=True)
+ value: typing.Union[str, int, float] = attr.field(repr=True)
"""Value of the choice (up to 100 characters if a string)."""
@@ -367,7 +376,7 @@ class CommandInteractionOption:
type: typing.Union[OptionType, int] = attr.field(repr=True)
"""Type of this option."""
- value: typing.Union[str, int, bool, None] = attr.field(repr=True)
+ value: typing.Union[str, int, bool, float, None] = attr.field(repr=True)
"""Value provided for this option.
Either `CommandInteractionOption.value` or `CommandInteractionOption.options`
