Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nanato12/phine
LINE Official Bot PHP Library
https://github.com/nanato12/phine
linebot php php-linebot wrapper
Last synced: 15 days ago
JSON representation
LINE Official Bot PHP Library
- Host: GitHub
- URL: https://github.com/nanato12/phine
- Owner: nanato12
- License: apache-2.0
- Created: 2020-05-02T13:10:44.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2024-07-14T02:41:31.000Z (5 months ago)
- Last Synced: 2024-11-01T18:16:48.614Z (about 2 months ago)
- Topics: linebot, php, php-linebot, wrapper
- Language: PHP
- Homepage: https://packagist.org/packages/nanato12/phine
- Size: 104 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Phine
LINE Messaging API SDK for PHP Wrapper
## Instance
### Client
This class is extend [LINE\Clients\MessagingApi\Api\MessagingApiApi](https://github.com/line/line-bot-sdk-php/blob/master/src/clients/messaging-api/lib/Api/MessagingApiApi.php).
```php
$client = new Client($channelAccessSecret, $channelAccessToken);
```## Message Builders
### RawFlexMessageBuilder
Builder that generates FlexMessage from array.
in `flex.json`
```json
{"type":"carousel","contents":[{"type":"bubble", ...}]}
``````php
$fileContent = file_get_contents("flex.json");
$flexContentArray = json_decode($fileContent, true);
$flexMessage = new RawFlexMessageBuilder($flexContentArray);
```### TextMessageBuilder
```php
$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.
```php
$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.
```php
$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.
```php
$client->getProfileFromUserID($userID);
```