Skip to content

yukato/linebot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LineBot

<?php
require_once 'LineBot.php';
require_once 'LineSend.php';
require_once 'LineRecv.php';

$config = [
    'endpointHost' => 'trialbot-api.line.me',
    'channel'      => [
        'id'     => $_ENV['LINE_CHANNEL_ID'],
        'secret' => $_ENV['LINE_CHANNEL_SECRET'],
        'mid'    => $_ENV['LINE_BOT_MID'],
    ]
];

$lineRecv = new LineRecv($config);
$response = $lineRecv->receive();

$lineSender = new LineSend($config);
foreach ($response->result as $result) {
    $userId = $result->content->from;
    $text   = $result->content->text;
    $result = $lineSender->sendText([ $userId ], $text);
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages