nanato12 / phine
LINE Messaging API SDK for PHP Wrapper
v4.0.1
2024-01-08 17:58 UTC
Requires
- linecorp/line-bot-sdk: 9.4.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.42
- phpstan/phpstan: ^1.10
- phpunit/phpunit: *
This package is auto-updated.
Last update: 2024-12-14 03:34:58 UTC
README
LINE Messaging API SDK for PHP Wrapper
Instance
Client
This class is extend LINE\Clients\MessagingApi\Api\MessagingApiApi.
$client = new Client($channelAccessSecret, $channelAccessToken);
Message Builders
RawFlexMessageBuilder
Builder that generates FlexMessage from array.
in flex.json
{"type":"carousel","contents":[{"type":"bubble", ...}]}
$fileContent = file_get_contents("flex.json"); $flexContentArray = json_decode($fileContent, true); $flexMessage = new RawFlexMessageBuilder($flexContentArray);
TextMessageBuilder
$textMessage = new TextMessageBuilder( text: 'text', emojis: [], quoteToken: 'quoteToken' );
Phine original functions
setEvent
Function to hold the received event information in an instance.
Used in the reply
function, etc.
$client->setEvent($event);
reply
Function to send a reply message.
A list of Message
, Sender
, and QuickReply
can be included in the argument at the same time.
$client->reply($messages, $sender, $quickReply);
getProfileFromUserID
Function to retrieve a profile from a user ID.
A function that combines three functions: group user retrieval, room user retrieval, and user retrieval.
$client->getProfileFromUserID($userID);