components#

class wyvern.models.components.ActionRow(*, components: list[wyvern.models.components.Component])[source]#

Bases: Component

class wyvern.models.components.Button(*, style: ButtonStyle, label: str | None = None, emoji: Any = None, custom_id: str | None = None, disabled: bool = False, url: str | None = None)[source]#

Bases: Component

Represents a discord button. The properties mentioned below can be used to create a button.

custom_id: str | None#

Custom id for the component.

disabled: bool#

True if the component is disabled.

emoji: Any#

Emoji embedded in the button.

label: str | None#

Button’s label.

style: ButtonStyle#

Style of the button.

url: str | None#

The URL this button points to, if any.

class wyvern.models.components.ButtonStyle(value)[source]#

Bases: IntEnum

Enums for Button style.

BLURPLE = 1#

Alias for PRIMARY

DANGER = 4#

Red discord button.

GRAY = 2#

Alias for SECONDARY

GREEN = 3#

Alias for SUCCESS

GREY = 2#

Alias for SECONDARY

Button pointing to an URL

PRIMARY = 1#

A primary blurple discord button.

RED = 4#

Alias for DANGER

SECONDARY = 2#

A secondary gray discord button.

SUCCESS = 3#

Green discord button.

URL = 5#

Alias for LINK

class wyvern.models.components.Component[source]#

Bases: ABC

Represents a discord component. Is the base class for other components.

class wyvern.models.components.ComponentType(value)[source]#

Bases: IntEnum

An enumeration.

class wyvern.models.components.Modal(*, title: str, custom_id: str, text_inputs: list[wyvern.models.components.TextInput])[source]#

Bases: object

Represents a discord modal form.

custom_id: str#

Custom ID of the modal

text_inputs: list[wyvern.models.components.TextInput]#

List of textinputs in the modal.

title: str#

Title of the modal.

final class wyvern.models.components.TextInput(*, custom_id: str, label: str, style: TextInputStyle, min_length: int | None = None, max_length: int | None = None, required: bool = True, default_value: str | None = None, placeholder: str | None = None)[source]#

Bases: Component

Represents a modal text-input.

custom_id: str#

Custom id of the textinput.

default_value: str | None#

Default value for this textinput.

label: str#

Label of the textinput.

max_length: int | None#

The minimum allowed length for textinput.

min_length: int | None#

The maximum allowed length for textinput.

placeholder: str | None#

The placeholder used, if any.

required: bool#

Weather the field is required.

style: TextInputStyle#

Textinput style.

class wyvern.models.components.TextInputStyle(value)[source]#

Bases: IntEnum

An enumeration.

PARAGRAPH = 2#

For multi line text-inputs.

SHORT = 1#

For single line text-inputs.