The application architecture of this application is going to be very similar to some of the other messenger bots I have built. It's going to include a Server side that's going to receive messages from Fb Messenger and relay them to Slack using Slack's commonly used incoming web hooks.
The beginning components of this application might look like this
Server for receiving messages from the messenger, instead of building our own we are going to use node-messenger-bot which allows us to do event based programming with bots, instead of doing it on our own by implementing our own express server for this, which is just a good amount of overhead to manage for us.
A library to convert the messenger format messages in a format which Slack supports, this library is going to be stateless, and free from the concerns of managing any state, so this can be made into it's own module in the future too.
Slack Incoming Webhook implementation
There are two ways to go about here, send request ourselves using a module such as axios and rebuild the wheel, or use node-slack-sdk which seems to be quite updated till now and can help us in implementing features. We are going about the second way, since we haven't done it in the past, and it could be exciting to learn this new library.
In the future using node-slack-sdk can also help us, if we plan to implement Outgoing webhook, to relay messages from Slack to Messenger too, however, we don't plan to do that right now, immediately.
The application architecture of this application is going to be very similar to some of the other messenger bots I have built. It's going to include a Server side that's going to receive messages from Fb Messenger and relay them to Slack using Slack's commonly used incoming web hooks.
The beginning components of this application might look like this
Slack Incoming Webhook implementation
There are two ways to go about here, send request ourselves using a module such as
axios
and rebuild the wheel, or use node-slack-sdk which seems to be quite updated till now and can help us in implementing features. We are going about the second way, since we haven't done it in the past, and it could be exciting to learn this new library.