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

local rm = require("discordia-reaction-menu")

local value = "false"

local menu = rm.Menu{
	startPage = rm.Page{
		title = "Start Page!",
		description = "This is the start page of this menu.",
		choices = {
			rm.Choice{
				name = "Set a setting",
				value = function(self, menu, data)
					return value
				end,
				destination = rm.Page{
					title = "Set a setting",
					description = "Reply to this message with the new setting",
					isPrompt = true,
					onPrompt = function(self, menu, data, message)
						value = message.content
						return true
					end
				}
			},
			rm.Choice{
				name = "Do nothing, but with onChoose",
				onChoose = function(self, menu, data)
					return menu.startPage
				end
			},
			rm.Choice{
				name = "Go to another page",
				destination = rm.Page{
					title = "Empty page",
					description = "This page does nothing."
				}
			}
		}
	}
}

-- this line would be inside a messageCreate event
rm.send(message.channel, message.author.id, menu)