The Event
Event methods
event.match()
say Question(
"What is 2+2?",
buttons=[Button(4) as ok, Button(5) as notok]
)
hold
if (event.match(ok)) say "That's correct!"
else say "Wrong answer. The right answer was {{ok.title}}"say Question(
"What is your favorite color",
buttons=[
Button("red") as btnred,
Button("blue") as btnblue,
]
)
hold
// this will be true if the user clicked
// on one of the buttons, or typed "red" or "blue"
if (event.match(btnred, btnblue)) remember favcolor = event
else say "{{event}} is not a valid answer"
event.match_array()
event.get_type()
Accessing event content values
Last updated
Was this helpful?