botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
78 stars 90 forks source link

channel-messenger configuration doesn't work #279

Closed bissolli closed 6 years ago

bissolli commented 6 years ago

Botpress version: 10.11.1

Channels: @botpress/channel-messenger


I can't save my settings through the Dashboard. Getting the following error in my logs:

TypeError: config.saveAll is not a function
    at /my-chatbot/node_modules/@botpress/channel-messenger/bin/webpack:/src/index.js:212:16
    at Layer.handle [as handle_request] (/my-chatbot/node_modules/express/lib/router/layer.js:95:5)
    at next (/my-chatbot/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/my-chatbot/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/my-chatbot/node_modules/express/lib/router/layer.js:95:5)
    at /my-chatbot/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/my-chatbot/node_modules/express/lib/router/index.js:335:12)
    at next (/my-chatbot/node_modules/express/lib/router/index.js:275:10)
    at /my-chatbot/node_modules/body-parser/lib/read.js:130:5
    at invokeCallback (/my-chatbot/node_modules/raw-body/index.js:224:16)
    at done (/my-chatbot/node_modules/raw-body/index.js:213:7)
    at IncomingMessage.onEnd (/my-chatbot/node_modules/raw-body/index.js:273:7)
    at emitNone (events.js:106:13)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
slvnperron commented 6 years ago

@bissolli Can you update your channel-messenger version? There's no more UI.

bissolli commented 6 years ago

Hey @slvnperron , it was 10.0.2! I had to run npm install --save @botpress/channel-messenger@10.11.1 to get the latest one. Running only npm install --save @botpress/channel-messenger I get the 10.0.2.

Problem solved!

Quick question, now that I have the channel-messenger under the config folder and don't have UI anymore, how can I make my setting take effect? For example, I want to add Get Started button, I set as true in the settings file, but even restarting the service running bp start, it doesn't take effect!

Log:

> botpress start

21:59:44 - info: Starting botpress version 10.11.1
21:59:44 - info: [Ghost Content Manager] (transparent) Initialized
21:59:44 - info: [Skills] Initiated
21:59:44 - warn: DEPRECATION NOTICE – bp.umm is deprecated and will be removed in `botpress@3.0` – Please see bp.renderers instead.
21:59:44 - info: Loaded @botpress/audience, version 10.11.1
21:59:44 - info: Loaded @botpress/channel-messenger, version 10.11.1
21:59:45 - info: Loaded @botpress/channel-web, version 10.11.1
21:59:45 - info: Loaded @botpress/hitl, version 10.11.1
21:59:45 - info: Loaded @botpress/nlu, version 10.11.1
21:59:45 - info: Loaded @botpress/skill-choice, version 10.11.1
21:59:45 - info: Loaded 6 modules
21:59:45 - info: [Skills] Loaded 1 skills
21:59:45 - info: Read 7 item(s) from builtin_text.json
21:59:45 - info: Bot launched. Visit: http://localhost:3000
21:59:46 - info: ------------
21:59:46 - info: Webchat available at http://localhost:3000/s/chat
21:59:46 - info: ------------
21:59:47 - error:  Error: An error has been returned by Facebook API.
Status: 400 (Bad Request)
An unknown error occurred
    at /botpress/node_modules/@botpress/channel-messenger/bin/webpack:/src/messenger.js:615:15
    at PassThroughHandlerContext.finallyHandler (/botpress/node_modules/bluebird/js/release/finally.js:56:23)
    at PassThroughHandlerContext.tryCatcher (/botpress/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/botpress/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/botpress/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/botpress/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/botpress/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/botpress/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/botpress/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/botpress/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)

Bot seems to be working on facebook messenger, but get started button, persistent menu and others settings don't .

slvnperron commented 6 years ago

I think the problem is the error 400 might prevent further configuration from being saved to Facebook. Please remove the ads permission from the default permissions in the channel-messenger.json file and see if that helps. (A PR would be nice if that works)