# Create a message with buttonscreateanewmessageandstoreitin{_msg}:setcontentofmessageto"Click a button!"# Single buttonaddnewprimarybuttonwithid"btn1"named"Click me!"torowsofmessage# Multiple buttons in one rowmakenewcomponentrowandstoreitin{_row}:addnewsuccessbuttonwithid"btn2"named"Green"tocomponentsofrowbuilderaddnewdangerbuttonwithid"btn3"named"Red"tocomponentsofrowbuilderadd{_row}torowsofmessage# Send the messagereplywith{_msg}# Handle button clicksonbuttonclick:ifevent-stringis"btn1":replywith"You clicked the first button!"elseifevent-stringis"btn2":replywith"You clicked the green button!"elseifevent-stringis"btn3":replywith"You clicked the red button!"
String Select Menu
# Create a message with a string select menucreateanewmessageandstoreitin{_msg}:setcontentofmessageto"Select an option!"set{_select}tonewdropdownwithid"string_select"setplaceholderof{_select}to"Choose wisely..."setminrangeof{_select}to1setmaxrangeof{_select}to1addnewoptionwithvalue"option1"named"Option 1"withdescription"This is the first option"tooptionsof{_select}addnewoptionwithvalue"option2"named"Option 2"withdescription"This is the second option"tooptionsof{_select}addnewoptionwithvalue"option3"named"Option 3"withdescription"This is the third option"tooptionsof{_select}add{_select}torowsofmessage# Send the messagereplywith{_msg}# Handle select menu interactionson dropdownclick:ifevent-stringis"string_select":set{_selected}tofirstelementof(selectedvalues)replywith"You selected: %{_selected}%"
Entity Select Menu
# Create a message with an entity select menucreateanewmessageandstoreitin{_msg}:setcontentofmessageto"Select users or roles!"set{_select}tonewentitydropdownwithid"entity_select"targeting"users"and"roles"setplaceholderof{_select}to"Choose users or roles..."setminrangeof{_select}to1setmaxrangeof{_select}to3add{_select}torowsofmessage# Send the messagereplywith{_msg}# Handle entity select menu interactionsonentitydropdownclick:ifevent-stringis"entity_select":set{_selected::*}toselectedentitiesreplywith"You selected: %{_selected::*}%"
Modal with Text Inputs
# Create a button to open the modalcreateanewmessageandstoreitin{_msg}:setcontentofmessageto"Click to open the form!"addnewprimarybuttonwithid"open_modal"named"Open Form"torowsofmessage# Send the messagereplywith{_msg}# Handle button click to open modalonbuttonclick:ifevent-stringis"open_modal":set{_modal}tonewmodalwithid"example_modal"named"Example Form"# Short text inputset{_short_input}tonewshorttextinputwithid"short_answer"named"Short Answer"setplaceholderof{_short_input}to"Enter a short response..."setminimumrangeof{_short_input}to1setmaximumrangeof{_short_input}to100setrequiredstateof{_short_input}totrueadd{_short_input}torowsof{_modal}# Paragraph text inputset{_long_input}tonewtextinputwithid"long_answer"named"Long Answer"setplaceholderof{_long_input}to"Enter a longer response..."setminimumrangeof{_long_input}to10setmaximumrangeof{_long_input}to1000add{_long_input}torowsof{_modal}# Show the modalshow{_modal}toevent-user# Handle modal submissionsonmodalreceive:ifevent-stringis"example_modal":set{_short_answer}tovalueoftextinputwithid"short_answer"set{_long_answer}tovalueoftextinputwithid"long_answer"replywith"Short answer: %{_short_answer}%%nl%Long answer: %{_long_answer}%"