Choice - object-Object/discordia-reaction-menu GitHub Wiki

This page details how to properly create a Choice object using rm.Choice().

Properties

Property Type Optional Autogenerated Description
destination Page The page to which the menu will go if this choice is selected. Either this or onChoose must be provided, but not both.
name string The name of the choice. Will be displayed in the page.
type string The type of the object.

Methods

onChoose(self, menu, data)

Parameter Type
self Choice
menu Menu
data table

A function to be executed if this choice is selected. Either this or destination must be provided, but not both. Returns the next page to go to, or true to go back to the previous page.

Returns: Page


getValue(self, menu, data)

Parameter Type
self Choice
menu Menu
data table

A function to get the value of the choice. If this function is provided, the returned string will be put in brackets after the name.

Returns: string