This node.js example connector allows you to make your Teneo bot available on LINE. This guide will take you through the steps of creating a new LINE Provider and deploying the connector to respond to events sent by Teneo.
You can find the source code of this project on Github.
Making the connector available via https is preferred. Ngrok is recommended for this.
The LINE app should already be running with an active account on your device.
Your bot needs to be published and you need to know the engine URL.
Install dependencies by running the following command in the folder where you stored the source:
Create a .env file in the folder where you stored the source, and add values for TENEO_ENGINE_URL, CHANNEL_SECRET, and CHANNEL_ACCESS_TOKEN:
CHANNEL_SECRET=<that value obtained in the previous section>
CHANNEL_ACCESS_TOKEN=<that other value issued in the previous section>
Start the connector in Console:
Next, we need to make the connector available via https. We'll use ngrok for this.
Start ngrok. The connector runs on port 3000 by default, so we need to start ngrok like this:
ngrok http 3000
Running the command above will display a public https URL. Copy it, you will need it in the next section.
Update Webhook URL in the line provider
Once the connector is available via https, copy the public https URL from the previous step andp paste in into the Webhook URL of your Line Channel provider. Also, add a /callback suffix to the URL field. The final Webhook URL should look roughly like this:
Click the blue 'Update' button to save the url.
Start chatting with the bot.
Still in the Channel settings of your Provider, scroll down to the QR code shown in the bots section. Use it to add your bot as a new contact to your LINE app.
That's it! Your bot should now be available in LINE and responding to messages that are sent to it.