-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Siratee K edited this page Feb 4, 2020
·
7 revisions
This wiki will show you all of the commands in the LINE API Helper package and how to use it!.
LINE API Helper is an npm package helping you develop your chatbot using LINE Messaging API easier. This dependency will handle all of the request jobs for you. Moreover, This dependency will help you decode the request so you can get the data from that request easier.
Update: LINE API Helper from version 0.1.1 is support with Dialogflow. You can use the same code to easily get the data from the request or send the message to the user.
All command references are in this page (Click here to go to the package reference page)
This is the example code using LINE API Helper hosted by Firebase Cloud Function
exports.LINEAPIHelper = functions.https.onRequest((req, res) => {
const lah = require("lineapihelper");
lah.setrequest(req);
lah.cat("Your channel access token");
var payload = [
{
type: "text",
text: "Hello from lineapihelper",
}
]
return lah.reply(lah.replyToken(), payload).then((response) => {
console.log(response)
return res.status(200).send();
}).catch((e) => {
console.log(e)
return res.status(500).send();
})
})