Skip to content
Siratee K edited this page Feb 4, 2020 · 7 revisions

Welcome to the lineapihelper wiki!

This wiki will show you all of the commands in the LINE API Helper package and how to use it!.

What is LINE API Helper?

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.

Package Reference

All command references are in this page (Click here to go to the package reference page)

Example Code

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();
  })
})