discord-interactions.py

Integer

Fonction

Option nombre entier, avec bornes, pas, choix et autocomplétion.

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

Paramètres

NomTypeDéfautDescription
namestrrequis
descriptionstrrequis
requiredboolTrue
defaultAnyNone
min_valueint | NoneNoneValeur minimale.
max_valueint | NoneNoneValeur maximale.
choicesList[Choice | Tuple[str, int]] | NoneNone
autocompleteCallable[..., Awaitable[List[Tuple[str, Any]]]] | NoneNone
stepint | NoneNoneLa valeur doit être un multiple de ce pas.
validatorCallable[[int], bool | str] | NoneNone
transformerCallable[[int], Any] | NoneNone
localizationsDict[str, Tuple[str, str]] | NoneNone

Retour

IntegerOption

Tape un nom : create_button, ModalBuilder, cooldown.