discord-interactions.py

UserOption

Class

User option (created by User).

from discord_interactions.slash import UserOption

Extends OptionBase

Constructor

UserOption(    name: str,    description: str,    required: bool = True,    name_localizations: Dict[str, str] | None = None,    description_localizations: Dict[str, str] | None = None,    default: Any = None,    validator: Callable[[Any], bool | str] | None = None,    transformer: Callable[[Any], Any] | None = None,    allow_bots: bool = True,    require_in_voice: bool = False,)
NameTypeDefaultDescription
namestrrequired
descriptionstrrequired
requiredboolTrue
name_localizationsDict[str, str] | NoneNone
description_localizationsDict[str, str] | NoneNone
defaultAnyNone
validatorCallable[[Any], bool | str] | NoneNone
transformerCallable[[Any], Any] | NoneNone
allow_botsboolTrue
require_in_voiceboolFalse

Properties

NameTypeDescription
namestr
descriptionstr
requiredbool
name_localizationsDict[str, str] | None
description_localizationsDict[str, str] | None
defaultAny
validatorCallable[[Any], bool | str] | None
transformerCallable[[Any], Any] | None
allow_botsbool
require_in_voicebool

Methods

to_dict

def to_dict() -> Dict[str, Any]

Type a name: create_button, ModalBuilder, cooldown.