vars : object

Helpers for res.setState() method

Kind: global constant

 

vars.dialogContext(key, value) ⇒ object

Sets variable, which will be removed, when user leaves the dialogue. Variable will be available at first interaction of next dialogue. Then it will be removed.

Kind: static method of vars

Param Type
key string
value *

Example

const { vars } = require('wingbot');
res.setState(vars.dialogContext('myKey', 'foovalue'))
 

vars.expiresAfter(key, value, turnovers) ⇒ object

Sets variable, which will be removed after specified number of conversation turonovers

Kind: static method of vars

Param Type
key string
value *
turnovers number

Example

const { vars } = require('wingbot');
res.setState(vars.expiresAfter('myKey', 'foovalue', 4))
 

vars.preserveMeta(key, value, state) ⇒ object

Sets variable while preserving its metadata

Kind: static method of vars

Param Type
key string
value *
state object

Example

const { vars } = require('wingbot');
res.setState(vars.preserveMeta('myKey', 'foovalue', req.state))

results matching ""

    No results matching ""