PHP Class pimax\FbBotApp

Afficher le fichier Open project: pimax/fb-messenger-php

Protected Properties

Свойство Type Description
$apiUrl string FB Messenger API Url
$token null | string

Méthodes publiques

Méthode Description
__construct ( string $token ) FbBotApp constructor.
deletePersistentMenu ( ) : array Remove Persistent Menu
send ( Message $message ) : array Send Message
setPersistentMenu ( MessageButton[] $buttons ) : array Set Persistent Menu
userProfile ( integer $id, string $fields = 'first_name,last_name,profile_pic,locale,timezone,gender' ) : UserProfile Get User Profile Info

Méthodes protégées

Méthode Description
call ( string $url, array $data, string $type = self::TYPE_POST ) : array Request to API

Method Details

__construct() public méthode

FbBotApp constructor.
public __construct ( string $token )
$token string

call() protected méthode

Request to API
protected call ( string $url, array $data, string $type = self::TYPE_POST ) : array
$url string
$data array
$type string Type of request (GET|POST|DELETE)
Résultat array

deletePersistentMenu() public méthode

Remove Persistent Menu
See also: https://developers.facebook.com/docs/messenger-platform/thread-settings/persistent-menu
public deletePersistentMenu ( ) : array
Résultat array

send() public méthode

Send Message
public send ( Message $message ) : array
$message pimax\Messages\Message
Résultat array

setPersistentMenu() public méthode

Set Persistent Menu
See also: https://developers.facebook.com/docs/messenger-platform/thread-settings/persistent-menu
public setPersistentMenu ( MessageButton[] $buttons ) : array
$buttons pimax\Messages\MessageButton[]
Résultat array

userProfile() public méthode

Get User Profile Info
public userProfile ( integer $id, string $fields = 'first_name,last_name,profile_pic,locale,timezone,gender' ) : UserProfile
$id integer
$fields string
Résultat UserProfile

Property Details

$apiUrl protected_oe property

FB Messenger API Url
protected string $apiUrl
Résultat string

$token protected_oe property

protected null|string $token
Résultat null | string