Write formats
A conversation is also accompanied by graphic components. We can create formats with the format
property.
In main.js
In ConverseScript, let's use the @Format()
decorator
The decorator applies to the message to be sent. The result will be Hello :)
With parameters
Here is another example, more in depth:
Here is the format
At the exit, we will have:
We can test it with
newbot emulator
Return a promise
A format can return a promise if asynchronous notions are executed
API
Parameter
Type
Description
nameFormat
String
Format name
text
String
Text output
params
Array
Parameter table sent by the decorator @Format()
data
Object
Object sent in the exec()
method
Last updated