定制 jeurboy/line-sdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jeurboy/line-sdk

Composer 安装命令:

composer require jeurboy/line-sdk

包简介

Line SDK for PHP.

README 文档

README

PHP Line SDK Class

Line Notify Document

Requirement

Composer

Install the latest version with composer

composer require jeurboy/line-php-sdk

Generate Line Notify Token

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

Notify Usage

Example : Simple notify with text message

namespace Jeurboy\LineSdk;

require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload

$receipientToken = '========== Notify token ==========';

$line_noti = Line::notify($receipientToken);

$line_text = Line::textMessage();
$line_text->setMessage('Test');

if ($line_noti->send( $line_text ) !== true) {
    echo $line_noti->getErrorMessage()."\n";
} else {
    echo "Success\n";
}

Chat bot auto reply usage

Example : Chat bot and auto reply with text message

namespace Jeurboy\LineSdk;

require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload

$accessToken = '========== Access token ==========';
$channelSecret = '========== Channel secret key ==========';

$request = file_get_contents('php://input');   // Get request content

$line_bot = Line::bot($accessToken, $channelSecret);

$line_text = Line::textMessage();

$parser = Line::eventParser($request);
$events = $parser->parseEvents();

foreach ($events as $event) {
    switch ($event->getType()) {
        case 'Text':
            $line_text->setMessage('Test reply : '.$event->getMessage());
            $line_bot->send($event->getReplyToken(), $line_text);

            break;
    }
}

License

Jeurboy License

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-12-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固