kittinan/php-line-notify

PHP Line Notify

0.5 2017-12-17 02:56 UTC

This package is auto-updated.

Last update: 2024-09-19 21:49:36 UTC


README

Build Status Code Coverage Scrutinizer Code Quality License: MIT

简单的PHP Line Notify类

Line Notify文档

需求

Composer

使用composer安装最新版本

composer require kittinan/php-line-notify

https://packagist.org.cn/packages/kittinan/php-line-notify

生成Line Notify令牌

https://notify-bot.line.me/my/

用法

示例:通知文本消息

$token = 'YOUR LINE NOTIFY TOKEN';
$ln = new KS\Line\LineNotify($token);

$text = 'Hello Line Notify';
$ln->send($text);

示例:通知带图片的文本

$text = 'Hello Line Notify';
$image_path = '/YOUR/IMAGE/PATH'; //Line notify allow only jpeg and png file
$ln->send($text, $image_path);

//HTTP or HTTPS image path
$image_path = 'https://lorempixel.com/800/600/'; //Line notify allow only jpeg and png file
$ln->send($text, $image_path);

示例:通知带贴纸的文本

查看贴纸列表 https://devdocs.line.me/files/sticker_list.pdf

$text = 'Hello Sticker';
$sticker = ['stickerPackageId' => '1', 'stickerId' => '401'];
$ln->send($text, null, $sticker);

屏幕截图

Screenshot

许可证

MIT许可证 (MIT)