This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Creating a multi-platform bot v4 #1912
Comments
Same here. It seems that v4 does not support multiple platforms. |
Yes it does! You can create 2 web endpoints on the same Express webserver, and pass in different adapters to each. This requires either setting up your own Express, or extending controller.webserver (which is an Express instance) |
Duplicate of #1910 |
Alright yall, here is an example: https://github.com/howdyai/botkit/blob/master/packages/testbot/multiadapter.js |
Improvements to this will also be in the next release -> #1929 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm trying to create a multi-bot using web & facebook
it's seems impossible to configure two simultaneous adapters as example, and it's understandable, of course I cant create a second socket using a same port... But anyone knows the right way to do that? Any doc about it?
const fbadapter = new FacebookAdapter({
enable_incomplete: true,
verify_token: process.env.FACEBOOK_VERIFY_TOKEN,
access_token: process.env.FACEBOOK_ACCESS_TOKEN,
app_secret: process.env.FACEBOOK_APP_SECRET,
})
fbadapter.use(new FacebookEventTypeMiddleware());
const fbcontroller = new Botkit({
webhook_uri: '/api/messages',
adapter: fbadapter,
storage
});
controller.ready(() => {
controller.loadModules(__dirname + '/features');
});
Error:
events.js:187
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::5000
at Server.setupListenHandle [as _listen2] (net.js:1306:14)
at listenInCluster (net.js:1354:12)
at Server.listen (net.js:1442:7)
at new Botkit (/Users/ricagurgel/GitHub/botkit4/web/node_modules/botkit/lib/core.js:146:27)
at Object. (/Users/ricagurgel/GitHub/botkit4/web/bot.js:30:22)
at Module._compile (internal/modules/cjs/loader.js:1121:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1160:10)
at Module.load (internal/modules/cjs/loader.js:976:32)
at Function.Module._load (internal/modules/cjs/loader.js:884:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:67:12)
Emitted 'error' event on Server instance at:
at emitErrorNT (net.js:1333:8)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'EADDRINUSE',
errno: -48,
syscall: 'listen',
address: '::',
port: 5000
}
npm
The text was updated successfully, but these errors were encountered: