Functions
- createProcessor(reducer, processorOptions, [stateStorage])
Create a chat event processor
- createUpdater(lambdaName, [token], [log])
Create updater handler for wingbot which deploys new lambda version
listens for POST on
/update
- createHandler(processor, verifyToken, [log], [onDispatch])
Create an serverless handler for accepting messenger events
- createValidator(config, [log], [onDispatch])
Create validator handler for wingbot configurations
listens for POST on
/validate
createProcessor(reducer, processorOptions, [stateStorage])
Create a chat event processor
Kind: global function
Param | Type | Description | |
---|---|---|---|
reducer | function \ |
Router |
Root router object or processor function |
processorOptions | Object |
settings for message processing | |
[processorOptions.pageToken] | string |
page token | |
[processorOptions.appSecret] | string |
bot application secret | |
[processorOptions.appUrl] | string |
where the bot application is deployed | |
[processorOptions.timeout] | number |
how long the state will be locked for single event | |
[processorOptions.log] | Object |
console.log/error/warn like object | |
[processorOptions.defaultState] | Object |
default conversation state | |
[processorOptions.chatLog] | DynamoChatLog |
discussion logger | |
[processorOptions.tokenStorage] | DynamoBotToken |
storage for chabot tokens | |
[processorOptions.senderFnFactory] | function |
override default sender function | |
[processorOptions.securityMiddleware] | function |
override webview calls authorizer | |
[processorOptions.cookieName] | string |
webview cookie (for default securityMiddleware) | |
[processorOptions.loadUsers] | boolean |
set false to not load user profiles | |
[processorOptions.userLoader] | Object |
override default user loader | |
[processorOptions.onSenderError] | function |
override default sender error reporter | |
[processorOptions.autoTyping] | Object \ |
boolean |
enable auto typing |
[processorOptions.autoTyping.time] | number |
default typing time | |
[processorOptions.autoTyping.perCharacters] | number |
typing time per character | |
[processorOptions.autoTyping.minTime] | number |
auto typing lower threshold | |
[processorOptions.autoTyping.maxTime] | number |
auto typing upper threshold | |
[processorOptions.dynamo] | Object |
dynamodb configuration | |
[processorOptions.dynamo.db] | AWS.DynamoDB |
dynamodb db object | |
[processorOptions.dynamo.tablePrefix] | string |
dynamodb table prefix | |
[stateStorage] | DynamoState |
storage for states |
createUpdater(lambdaName, [token], [log])
Create updater handler for wingbot which deploys new lambda version
listens for POST on /update
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
lambdaName | string |
bot handler name | |
[token] | string |
null |
bot authorization token |
[log] | object |
console.* like logger object |
createHandler(processor, verifyToken, [log], [onDispatch])
Create an serverless handler for accepting messenger events
Kind: global function
Param | Type | Description | |
---|---|---|---|
processor | Processor \ |
Hook |
Root router object or processor function |
verifyToken | string |
chatbot application token | |
[log] | object |
console.* like logger object | |
[onDispatch] | function |
will be called after dispatch of all events |
createValidator(config, [log], [onDispatch])
Create validator handler for wingbot configurations
listens for POST on /validate
Kind: global function
Param | Type | Description |
---|---|---|
config | object |
|
[config.token] | string |
authorization token |
[config.blocksResource] | Blocks |
authorization token |
[config.routerFactory] | function |
creates blank router for testing purposes |
[config.testText] | string |
text for router testing (null to disable) |
[config.testPostBack] | string |
postback to test the bot (null to disable) |
[log] | object |
console.* like logger object |
[onDispatch] | function |