Allows Line users to submit flood reports via text message chat bot. Part of the CogniCity platform, deployed for Urban Risk Map.
This module deploys two AWS lambda functions:
- A webhook for incoming messages from Line
- A reply function to send confirmation messages
npm install
- CogniCity:
- This function is designed to work with Cognicity Server v3.0.6 or later, running CogniCity Schema v3.0.7 or later.
- Node:
- v8.10 or later (ES6 syntax is transpiled using Babel)
- Create Line bot as explained here
- Create two AWS API gatway endpoints for the webhook and send functions
- Add the appropriate parameters in
src/configand.env. - Send a text to your Line bot to test if it is up and running!
npm run test
ACCESSTOKEN: Line access token to trigger the webhook functionCHANNELSECRET: Line channel secret code created on creating a botAPI_GW_WEBHOOK: CogniCity server endpoint to get unique report card linksCARDSAPIKEY: CogniCity server API keyCARDS_URL: Client address for cardsPREP_URL: Client address for prep cardsDEFAULT_INSTANCE_COUNTRY_CODE: Default country for message files (e.g. 'us')DEFAULT_LANGUAGE: Current default language is English. You can add more languages here and parameterize replies for each language
- Depending on your deployment method you may need to add the above parameters to the Lambda functions in the AWS web console