Integration - facebook message (11.x)

#1

How do we integrate a bot with facebook message? I read the docs and tutorials and I don’t find any information about it.

1 Like
#2

You can check some docs at https://github.com/botpress/botpress/tree/master/modules/channel-messenger

#3

I’m following the doc but I can’t setup a webhook on facebook.
The facebook don’t validate the webhook url and the botpress server show me a warning.

I have a close deadline and I need configurate this as soon as possible.

My configurations:

{
  "$schema": "../../../../assets/modules/channel-messenger/config.schema.json",
  "enabled": true,
  "appSecret":"aXXX609cd6b6f5457c0a424d47b42876",
  "verifyToken":"pXXXJYVqA8OVT0tEYvpW0mSbk7t63eJZ",
"accessToken":"EXXXGozMhP6cBAMBFZCkwQ9jrOKZC8dugypWcn9m9SxiuhU8gKLwl8NOVxzuKEXd22n2qJoYPv3sEkDtMmcZClUTjOHXEiCIGS7KM9YN1VQ48Hys47keaH8TQQfB4ZBusVZAEasNb5ZCbVFJ17FdYZAyn9D9wFFkKWgshQHyISiP1N90XQpm2Osg",
  "persistentMenu": []
} 
  • My channel-messenger.json in global/config looks like
{
  "$schema": "../../../assets/modules/channel-messenger/config.schema.json",
  "enabled": true,
  "appSecret":"aXXX609cd6b6f5457c0a424d47b42876",
  "verifyToken":"pXXXJYVqA8OVT0tEYvpW0mSbk7t63eJZ",
  "persistentMenu": []
}
  • bot press server
11:03:23.671 Launcher ========================================
                                  Botpress Server
                                   Version 11.7.4
                                      OS win32
                      ========================================
11:03:25.796 Launcher Using 7 modules
                      ? MODULES_ROOT/analytics
                      ? MODULES_ROOT/basic-skills
                      ? MODULES_ROOT/builtin
                      ? MODULES_ROOT/channel-messenger
                      ? MODULES_ROOT/channel-telegram (disabled)
                      ? MODULES_ROOT/channel-web
                      ? MODULES_ROOT/hitl (disabled)
                      ? MODULES_ROOT/nlu
                      ? MODULES_ROOT/qna
11:03:26.479 Mod[channel-messenger] Channel misconfigured [TypeError, require(..
.) is not a function]
STACK TRACE
TypeError: require(...) is not a function
    at Object.<anonymous> (C:\Users\anav\Downloads\botpress-v11_7_4-win-x64\modu
les\.cache\module__be4e4b2b0b26d4cfd5c29deb5cc56e4da7ab6f0978a64c06f7785e364fbef
70a\node_production_modules\body-parser\lib\types\json.js:18:29)
    at Module._compile (internal/modules/cjs/loader.js:700:30)
    at Module._compile (pkg/prelude/bootstrap.js:1216:32)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:711:10)
    at Module.load (internal/modules/cjs/loader.js:610:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:549:12)
    at Function.Module._load (internal/modules/cjs/loader.js:541:3)
    at Module.require (internal/modules/cjs/loader.js:648:17)
    at Module.require (pkg/prelude/bootstrap.js:1160:31)
    at Module.module_1.default.require (C:\snapshot\build-windows\out\bp\sdk\rew
ire.js:0:0)
    at require (internal/modules/cjs/helpers.js:20:18)
    at loadParser (C:\Users\anav\Downloads\botpress-v11_7_4-win-x64\modules\.cac
he\module__be4e4b2b0b26d4cfd5c29deb5cc56e4da7ab6f0978a64c06f7785e364fbef70a\node
_production_modules\body-parser\index.js:142:16)
    at Function.get [as json] (C:\Users\anav\Downloads\botpress-v11_7_4-win-x64\
modules\.cache\module__be4e4b2b0b26d4cfd5c29deb5cc56e4da7ab6f0978a64c06f7785e364
fbef70a\node_production_modules\body-parser\index.js:123:12)
    at MessengerService.initialize (C:\Users\anav\Downloads\botpress-v11_7_4-win
-x64\modules\.cache\module__be4e4b2b0b26d4cfd5c29deb5cc56e4da7ab6f0978a64c06f778
5e364fbef70a\dist\backend\messenger.js:66:41)
11:03:27.309 Server Loaded 7 modules
11:03:27.361 CMS Loaded 6 content types
11:03:27.635 Mod[channel-messenger] Messenger Webhook URL is https://6747d4b4.ng
rok.io/api/v1/bots/___/mod/channel-messenger/webhook
11:03:28.020 Server Started in 2219ms
11:03:28.022 Launcher Botpress is ready at http://localhost:3000/

#4

Hello, i’m facing this issue too @carolgomesv did you manage to solve it?

Moreover, my bot server is with exactly the same error message:

 gabriel@Gabriels-MacBook-Pro  ~/Projects/esteira-de-lancamentos/botpress  EXTERNAL_URL=https://9a259ba9.ngrok.io ./bp                                                             ✔  10756  18:37:41
18:38:03.716 Launcher ========================================
                                  Botpress Server
                                   Version 11.8.0
                                     OS darwin
                      ========================================
18:38:05.357 Launcher Using 9 modules
                      ⦿ MODULES_ROOT/analytics
                      ⦿ MODULES_ROOT/basic-skills
                      ⦿ MODULES_ROOT/builtin
                      ⦿ MODULES_ROOT/channel-messenger
                      ⦿ MODULES_ROOT/channel-telegram
                      ⦿ MODULES_ROOT/channel-web
                      ⦿ MODULES_ROOT/hitl
                      ⦿ MODULES_ROOT/nlu
                      ⦿ MODULES_ROOT/qna
18:38:05.644 Mod[channel-messenger] Channel misconfigured [TypeError, require(...) is not a function]
STACK TRACE
TypeError: require(...) is not a function
    at Object.<anonymous> (/Users/gabriel/Projects/esteira-de-lancamentos/botpress/modules/.cache/module__f5b04bdfe94a50673599eb3afee02bfd792a5b0f921fb162ac172d89f63ace1a/node_production_modules/body-parser/lib/types/json.js:18:29)
    at Module._compile (internal/modules/cjs/loader.js:700:30)
    at Module._compile (pkg/prelude/bootstrap.js:1216:32)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:711:10)
    at Module.load (internal/modules/cjs/loader.js:610:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:549:12)
    at Function.Module._load (internal/modules/cjs/loader.js:541:3)
    at Module.require (internal/modules/cjs/loader.js:648:17)
    at Module.require (pkg/prelude/bootstrap.js:1160:31)
    at Module.module_1.default.require (/snapshot/build-mac/out/bp/sdk/rewire.js:0:0)
    at require (internal/modules/cjs/helpers.js:20:18)
    at loadParser (/Users/gabriel/Projects/esteira-de-lancamentos/botpress/modules/.cache/module__f5b04bdfe94a50673599eb3afee02bfd792a5b0f921fb162ac172d89f63ace1a/node_production_modules/body-parser/index.js:142:16)
    at Function.get [as json] (/Users/gabriel/Projects/esteira-de-lancamentos/botpress/modules/.cache/module__f5b04bdfe94a50673599eb3afee02bfd792a5b0f921fb162ac172d89f63ace1a/node_production_modules/body-parser/index.js:123:12)
    at MessengerService.initialize (/Users/gabriel/Projects/esteira-de-lancamentos/botpress/modules/.cache/module__f5b04bdfe94a50673599eb3afee02bfd792a5b0f921fb162ac172d89f63ace1a/dist/backend/messenger.js:66:41)
18:38:06.432 Server Loaded 9 modules
18:38:06.462 CMS Loaded 6 content types
18:38:06.613 Mod[channel-messenger] Messenger Webhook URL is https://9a259ba9.ngrok.io/api/v1/bots/___/mod/channel-messenger/webhook
18:38:06.939 Server Started in 1580ms
18:38:06.939 Launcher Botpress is ready at http://localhost:3000/
#5

I don’t have that issue.

Just checked version 11.8, yarn build and then EXTERNAL_URL="https://mrb.ionix.me" yarn start and no issues.

I am using node 10.15.1.

The only difference I see in the config is that I have accessToken in both config files shown in the example

#6

@gabfr I find a issue open on github about this error: https://github.com/botpress/botpress/issues/1639