lisawilliams / trollbustersbot-test

A Botpress-based Facebook bot to assist people who are experiencing online harassment
http://troll-busters.com
Other
0 stars 0 forks source link

Add opening QuickReply #4

Closed lisawilliams closed 6 years ago

lisawilliams commented 6 years ago

Adding the following lines to content.yml:

quick_replies:
      - <QR_GOOD> Good!
      - <QR_BAD> Bad 😔

Causes the bot to stop working. You can type 'hello' at it, and it will mark it as read, but it will not run the rest of the script. In the Botpress logs, I get the following error information:

Sep 20 14:07:47error: Unhandled Rejection in Promise: Promise { _bitField: 18087936, _fulfillmentHandler0: { YAMLException: duplicated mapping key at line 7, column 5: text: How are you doing? Please ... ^ at generateError (/app/node_modules/js-yaml/lib/js-yaml/loader.js:165:10) at throwError (/app/node_modules/js-yaml/lib/js-yaml/loader.js:171:9) at storeMappingPair (/app/node_modules/js-yaml/lib/js-yaml/loader.js:308:7) at readBlockMapping (/app/node_modules/js-yaml/lib/js-yaml/loader.js:1071:9) at composeNode (/app/node_modules/js-yaml/lib/js-yaml/loader.js:1332:12) at readBlockSequence (/app/node_modules/js-yaml/lib/js-yaml/loader.js:928:5) at composeNode (/app/node_modules/js-yaml/lib/js-yaml/loader.js:1331:12) at readBlockMapping (/app/node_modules/js-yaml/lib/js-yaml/loader.js:1062:11) at composeNode (/app/node_modules/js-yaml/lib/js-yaml/loader.js:1332:12) at readDocument (/app/node_modules/js-yaml/lib/js-yaml/loader.js:1492:3) at loadDocuments (/app/node_modules/js-yaml/lib/js-yaml/loader.js:1548:5) at loadAll (/app/node_modules/js-yaml/lib/js-yaml/loader.js:1556:19) at Object.safeLoadAll (/app/node_modules/js-yaml/lib/js-yaml/loader.js:1583:5) at module.exports (/app/node_modules/botpress/lib/webpack:/src/umm/engine.js:178:8) at parse (/app/node_modules/botpress/lib/webpack:/src/umm/index.js:42:12) at _callee3$ (/app/node_modules/botpress/lib/webpack:/src/umm/index.js:144:17) name: 'YAMLException', reason: 'duplicated mapping key', mark: Mark { name: null, buffer: 'welcome: # this is the #welcome bloc referenced in index.js\n - typing: true\n text: # Picks one randomly\n - Hey there!\n - Hello Lisa\n - Good day :)\n text: How are you doing? Please use the buttons below!\n quick_replies:\n - <QR_GOOD> Good!\n - <QR_BAD> Bad 😔\n - text: This is just a regular Hello World, I don\'t do anything ;)\n typing: 2s\n - text: Make sure to check out the \'index.js\' file to see how I work\n typing: true\n - wait: 5s\n - text: You can say goodbye now\n typing: 1s\n\ngoodbye:\n - text: You are leaving because of reason \n typing: true\n - Hope to see you back again soon! # if no other properties, you can just send a strings\n\u0000', position: 170, line: 6, column: 4 }, message: 'duplicated mapping key at line 7, column 5:\n text: How are you doing? Please ... \n ^' }, _rejectionHandler0: undefined, _promise0: undefined, _receiver0: undefined } Reason:

This may be due to the fact that I made no changes to index.js to present the .yml to the user. But I'm going to be reading a lot more documentation, I think.

lisawilliams commented 6 years ago

Looking at following QR example code:

https://botpress.io/examples/fb_send_qr