
- #MAKE A CHATBOT APP WITH NODE JS 2018 HOW TO#
- #MAKE A CHATBOT APP WITH NODE JS 2018 INSTALL#
- #MAKE A CHATBOT APP WITH NODE JS 2018 DOWNLOAD#
That means the value of x-line-signature differs between requests. A valid request must contain x-line-signature header which value depends on the request body sent. When the webhook receives an incoming request, first we need to validate that the request comes from LINE.
#MAKE A CHATBOT APP WITH NODE JS 2018 INSTALL#
To make sure that the request is coming from LINE server, you can check the x-line-signature header (will be exemplified later). For each events, after you process it, you can reply to the event by sending reply message(s) to LINE and then it will be forwarded to the user.įirst, install the following dependencies "bluebird": "~3.5.0", It contains a list of events, which should be processed one by one. Before starting to code, first you need to understand how it works. Once you've set a webhook URL, every time an event occurs, such as when a user follows your channel, sends a message, etc., LINE will send a request to the webhook URL. LINE_CHANNEL_ACCESS_TOKEN=123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123AbcABC=ĭon't forget to use require('dotenv') or any other similar modules anywhere in your project before reading those values. env file, add the following: LINE_CHANNEL_SECRET=1234abcd1234abcd1234abcd1234abcd You can configure it later after you've developed your bot. Another important setting is the webhook. You can also enable allow bot to join group chats if you want. As we're going to develop a chatbot, we can disable auto-reply messages and greeting messages. You'll get a popup asking for the time until current token becomes invalid (it's safe to use the default value of 0 hours beause it's never been issued before). In addition, you also need to request LINE to issue a new channel access token. What you need to look for at that page is the value of channel secret. If you haven't set your email, open Settings → Account and enter your email address. In addition, you also need to set an email address because it's required for login on LINE developer console. Then you'll need to enter basic info such as name, phone number and password.
#MAKE A CHATBOT APP WITH NODE JS 2018 DOWNLOAD#
If you haven't had an account, just download the app on your mobile phone.

In order to do so, you need to do the following steps The first thing to do is creating a channel.
#MAKE A CHATBOT APP WITH NODE JS 2018 HOW TO#
In this tutorial, I'll show you how to create a LINE chatbot using Node.js.

The solution is by creating a bot that can reply events automatically. If your channel has already have a lot of followers, it takes a lot of time if you've to reply every messages one by one. It also allows us to create channel, which can be added as friend by other users. It has a lot of features such as voice and video call, user timeline, custom theme and news service. LINE is a very popular messaging platform.
