Script Module
Control conversation flow with programming language styled script.
Install
npm install @machinat/core @machinat/http @machinat/script
yarn add @machinat/core @machinat/http @machinat/script
Docs
Check the Dialog Script
document and the package reference.
Setup
Register the built script like this:
import Machinat from '@machinat/core';
import Script from '@machinat/script';
import BeforeSunrise from './scenes/BeforeSunset';
import BeforeSunset from './scenes/BeforeSunset';
import BeforeMidnight from './scenes/BeforeSunset';
const app = Machinat.createApp({
modules: [
Script.initModule({
libs: [
BeforeSunrise,
BeforeSunset,
BeforeMidnight,
],
}),
],
});