discord-interactions.py

Integer

Function

Integer option with bounds, step, choices and autocomplete.

from discord_interactions import Integer

Signature

def Integer(    name: str,    description: str,    *,    required: bool = True,    default: Any = None,    min_value: int | None = None,    max_value: int | None = None,    choices: List[Choice | Tuple[str, int]] | None = None,    autocomplete: Callable[..., Awaitable[List[Tuple[str, Any]]]] | None = None,    step: int | None = None,    validator: Callable[[int], bool | str] | None = None,    transformer: Callable[[int], Any] | None = None,    localizations: Dict[str, Tuple[str, str]] | None = None,) -> IntegerOption

Parameters

NameTypeDefaultDescription
namestrrequired
descriptionstrrequired
requiredboolTrue
defaultAnyNone
min_valueint | NoneNoneMinimum value.
max_valueint | NoneNoneMaximum value.
choicesList[Choice | Tuple[str, int]] | NoneNone
autocompleteCallable[..., Awaitable[List[Tuple[str, Any]]]] | NoneNone
stepint | NoneNoneThe value must be a multiple of this step.
validatorCallable[[int], bool | str] | NoneNone
transformerCallable[[int], Any] | NoneNone
localizationsDict[str, Tuple[str, str]] | NoneNone

Returns

IntegerOption

Type a name: create_button, ModalBuilder, cooldown.