Documentation

Help

Write the conversational script

The writing of the conversational script uses a particular syntax. It's called ConverseScript. We have the syntax list under Syntaxe ConverseScript

In the file your-skill.converse, we have several functions representing user-specific dialogs and variables

Welcome

The code is the following

@Event('start')
start() {
    > Welcome !
}

The chatbot does not understand

If the chatbot does not understand, we can trigger a function

@Event('start')
start() {
    > Welcome !
}

@Event('nothing')
nothing() {
    > I don't know
}

If we want to put a random sentence, we have to include 3 dashes:

@Event('start')
start() {
    > Welcome !
}

@Event('nothing')
nothing() {
    ---
    > I don't know
    > What ?
    ---
}

<more: items = "['intent']" />

Request an entry

Use the native function Prompt(). The script waits for a user input before proceeding. It is possible to read the return of the input thanks to the magic variable :text

@Event('start')
start() {
    > Hello, what's your name !
    Prompt()
    > Hey { :text }
}

@Event('nothing')
nothing() {
    ---
    > I don't know
    > What ?
    ---
}

React to an intention

We can trigger a function using a regular expression. Of course, we can go further than just a regular expression.

@Event('start')
start() {
    > Welcome !
}

@Intent(/hello/i)
hello() {
    > Hey !
}

@Event('nothing')
nothing() {
    ---
    > I don't know
    > What ?
    ---
}