Skip to content

API Requests & Responses

Setiawan edited this page Aug 12, 2020 · 9 revisions

Requests

For convenience, the first argument of all the method may contains a TelegramObject which contains the target method payload. It's fields will be sent as payload.

example:

$payload = new TelegramObject();
$payload->peer = '@your_username';
$payload->message = 'Your Message';

Messages::sendMessage($payload);

Responses

All wrapped method returns a TelegramObject instance which wrapping the array response from message api into an "object notated" response. The TelegramObject implements the Illuminate\Contracts\Support\Arrayable contract.

examples:

$response = Messages::sendMessage('@your_username', 'Your Message');

dd($response->toArray());

Wrapped apis

Clone this wiki locally