Use @Event
An event on a function triggers this function according to a situation
start
The start
event triggers the function when the user launches the chatbot for the first time. Attention, only the first time!
@Event('start')
nameFunction() {
> I am ChatBot
}
startAndIntent
The startAndIntent
event triggers the function when the user launches the chatbot for the first time and triggers another intent. Attention, only once!
@Event('startAndIntent')
nameFunction() {
> I am Chatbot. I will try to answer your question
}
nothing
The event nothing
triggers the function if no other function is started.
@Event('nothing')
nameFunction() {
> What ?
}
on
The on
event triggers the function according to an outside call:
@Event('on', 'my-event')
nameFunction() {
> Your name is { :event.name }
}
canActivate
The canActivate
event fires to find out if a skill can be performed or not
@Event('canActivate')
auth() {
> Your password ?
Prompt()
if (:text == 'azerty') {
return true
}
return false
}
Last updated
Was this helpful?