Skip to content

Repository files navigation

LINE Bot Notify

English | 日本語

A library for easily sending push notifications to LINE Bot

Install

npm install linebot-notify

Usage

Create an instance by passing the LINE Bot channel access token as an argument.
Then simply execute the push method with any message as an argument.
Returns the remaining number of available pushes as the return value.

import{LineBotNotify}from"linebot-notify"constmain=async()=>{constnotify=newLineBotNotify({ channelAccessToken })constremainingQuota=awaitnotify.push("LINE Bot Notify!")console.log(remainingQuota)}main()

Constructor

Specify either a channel access token or a pair of channel ID and channel secret.

// Specify channel access tokenconstnotify=newLineBotNotify({ channelAccessToken })// Specify channel ID and channel secretconstnotify=newLineBotNotify({ channelId, channelSecret })

push(message, { to, notificationDisabled })

Optional parameters can be specified in addition to the message.

ParameterRequiredTypeDefaultDescription
messagestring-Specifies the message to send.
tostring | string[]undefinedSpecifies the recipient(s).
For single recipient, specify a user ID or group ID. For multiple recipients, specify an array of user IDs.
notificationDisabledbooleanfalseWhen set to true, notifications will not be sent when sending messages.
// Send a message (broadcast)awaitnotify.push("LINE Bot Notify!")// Send a message to a specific user or groupawaitnotify.push("LINE Bot Notify!",{to: "<User ID or Group ID>"})// Send a message to multiple users (multicast)awaitnotify.push("LINE Bot Notify!",{to: ["<User ID>","<User ID>"]})// Send a message without notificationsawaitnotify.push("LINE Bot Notify!",{notificationDisabled: true})

ライセンス

MIT

About

A library for easily sending push notifications to LINE Bot

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages