kittinan / php-line-notify
PHP Line Notify
0.5
2017-12-17 02:56 UTC
Requires
- php: >=5.5
- guzzlehttp/guzzle: >=6.2.2
Requires (Dev)
- phpunit/phpunit: 4.8.12
- satooshi/php-coveralls: dev-master
README
简单的PHP Line Notify类
需求
- PHP 5.5+
- guzzlehttp
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);
屏幕截图
许可证
MIT许可证 (MIT)