Page

class dpymenus.Page(*args: Any, **kwargs: Any)

Represents a single page inside a menu.

buttons(buttons)

Generates reaction buttons when the page is displayed. Returns itself for fluent-style chaining.

Parameters

buttons (List) – Specifies which emoji to use on this page.

Return type

Page

on_next(func)

Sets the function that will be called when the next event runs. Returns itself for fluent-style chaining.

Parameters

func (Callable) – Reference to a function or method that will execute on this event.

Return type

Page

on_fail(func)

Sets the function that will be called when the fail event runs. Returns itself for fluent-style chaining.

Parameters

func (Callable) – Reference to a function or method that will execute on this event.

Return type

Page

on_cancel(func)

Sets the function that will be called when the cancel event runs. Returns itself for fluent-style chaining.

Parameters

func (Callable) – Reference to a function or method that will execute on this event.

Return type

Page

on_timeout(func)

Sets the function that will be called when the timeout event runs. Returns itself for fluent-style chaining.

Parameters

func (Callable) – Reference to a function or method that will execute on this event.

Return type

Page

as_safe_embed()

Returns a page stripped of Callables and Page-specific properties so we can send it as a standard Embed.

Return type

Page

static convert_from(other)

Returns a Page object from an Embed object or valid dictionary.

Parameters

other (Union[Dict[str, Any], Embed]) – Embed or dictionary in a valid Embed format.

Return type

Page