discord-interactions.py

quick_container

Function

Complete container in one call: title, lines, thumbnail, section button or row of buttons.

from discord_interactions import quick_container

Signature

def quick_container(    *,    title: str | None = None,    lines: Iterable[str] | None = None,    color: int | None = 5793266,    button: Dict[str, Any] | None = None,    button_text: str = 'Action',    buttons: Sequence[Dict[str, Any]] | None = None,    separator_between_lines: bool = False,    thumbnail: str | None = None,) -> Dict[str, Any]

Parameters

NameTypeDefaultDescription
titlestr | NoneNoneTitle shown as ##.
linesIterable[str] | NoneNoneText blocks.
colorint | None5793266Border color.
buttonDict[str, Any] | NoneNoneAccessory button of a section.
button_textstr'Action'Text of the button's section.
buttonsSequence[Dict[str, Any]] | NoneNoneRow of buttons at the bottom.
separator_between_linesboolFalseSeparator between each line.
thumbnailstr | NoneNoneThumbnail next to the title.

Returns

Dict[str, Any]

Example

from discord_interactions import quick_button, quick_container carte = quick_container(    title="Statut",    lines=["**API** opérationnelle", "**Base** opérationnelle"],    buttons=[quick_button("rafraichir", "Rafraîchir")],)

Type a name: create_button, ModalBuilder, cooldown.