discord-interactions.py

create_auto_rows

Function

Places buttons and select menus into valid rows automatically.

from discord_interactions import create_auto_rows

Signature

def create_auto_rows(    components: Sequence[Dict[str, Any]],    max_buttons_per_row: int = 5,) -> List[Dict[str, Any]]

Parameters

NameTypeDefaultDescription
componentsSequence[Dict[str, Any]]required
max_buttons_per_rowint5Buttons per row (5 max).

Returns

List[Dict[str, Any]]

Type a name: create_button, ModalBuilder, cooldown.