- If you are starter for LINE bot, please see
How to get going with LINE
- If you want to do local debug, please follow
Local debug
- Make bot with Microsoft Bot Framework
- Publish Bot to Cloud. If you use Microsoft Azure, please follow this tutorial.
- Connect a bot to Direct Line channel and get secret key.
- Clone this repo and insert your
Direct Line secret key
,LINE Channel secret
andLINE Channel access token
in index.ts. - Open your bash or command prompt and type
npm run dev
to run bot. - Install and setup ngrok for tonneling LINE webhook to local debug environment.
- In your bash or command prompt type
ngrok http 9999
. - Copy https url. In the screen shot below, please copy
https://6da04349.ngrok.io
- Open your bot setting in LINE Developer page and update your webhook url.
- This is a time to send message to LINE. Please send test message, then you will get LINE message like this.
We are making instraction for Azure, but you can delopy this app to your own cloud environment and can connect Bot Framework and LINE.
-
Download the line app and sign up for line, if you don't have an account yet
-
Make sure you set up an email address and passwort for line, for example if you signed with facebook (App -> Settings -> Account)
-
Create LINE Business account
- LINE BUSINESS CENTER
- Messaging API -> Developer Trial
-
Get you account set up and get the channel access token
- LINE BUSINESS CENTER > Accounts > Your Account > Messaging API > Line Developers
- Create and save you Channel Access Token
-
Whitelist your server or dev machine
- To send messages to the the line messages endpoint you need to whitelist you local dev machines or server where you run you bot or connector
- Line Developers Portal -> Server IP Whitelist
-
Set up your webhook URL for line
- Line Developers Portal -> Edit -> Webhook URL
- You will need to set an https endpoint
- After saving the Webhook you can go back and click verify to test you endpoint
-
Connect the your Webhook to your Line account / Bot
- Visit the [Line@ Manager] -> Your Account -> Setting -> Messaging API -> Settings -> Use Webhooks -> Allow