4.3.11 • Published 6 years ago

line.js v4.3.11

Weekly downloads
58
License
MIT
Repository
github
Last release
6 years ago

Linejs

A wrapper for the line api in js.

if you have any questions feel free to msg me on Discord KingCosmic#2713 or line austyn-studdard

Installation

npm install --save line.js

Setup

  1. First of, to get real time events from line we have to make a http server

  2. If we want get that http server accesible to the real world instead of just localhost we will use ngrok

  3. To use ngrok you will have to open a cmd (Windows) or terminal (MacOS) and navigate to the folder where you have the

ngrok executable located and type ngrok http port replacing port with the port number you used in your config for line.js.

It will then give you a link that is something like https://8239483209.ngrok.io, copy that and head to your bots page

BotPage click on your bots Line Devlopers button and set its webhook to the ngrok link you got.

Usage

const line = require('line.js');

var client = new line.Client({
  channelAccessToken: "",
  channelSecret: "",
  port: "8080"
})

client.on("message", function(msg) {

  // msg = { content: String, author: Object, reply: function(content) }
  // msg.author = { username: String, id: Number, pictureUrl: Url, statusMessage: String, sendMessage: function(content) }
  // if its a group msg
  // msg.group = { id: Number, sendMessage: function(content), leave: function }

  if (msg.content == "ping") {
    msg.reply("pong");
  }

  if (msg.content == "msg me") {
    msg.author.sendMessage("Hello Sir");
  }

  if (msg.content == "leave" && msg.group) {
    msg.group.leave();
  }

})
4.3.11

6 years ago

4.3.10

6 years ago

4.3.9

6 years ago

4.3.8

6 years ago

4.3.7

6 years ago

4.3.6

6 years ago

4.3.5

6 years ago

4.3.4

6 years ago

4.3.3

6 years ago

4.3.2

6 years ago

4.3.1

6 years ago

4.3.0

6 years ago

4.2.0

6 years ago

4.1.0

6 years ago

4.0.0

6 years ago

3.4.1

7 years ago

3.4.0

7 years ago

3.3.2

7 years ago

3.3.1

7 years ago

3.3.0

7 years ago

3.2.6

7 years ago

3.2.5

7 years ago

3.2.4

7 years ago

3.2.3

7 years ago

3.2.2

7 years ago

3.2.1

7 years ago

3.2.0

7 years ago

3.1.3

7 years ago

3.1.2

7 years ago

3.1.1

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.4.1

7 years ago

2.3.2

7 years ago

2.3.1

7 years ago

2.3.0

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.1-security

8 years ago

0.0.2

10 years ago

0.0.1

10 years ago