PHP code example of bahramali / shad-php

1. Go to this page and download the library: Download bahramali/shad-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bahramali / shad-php example snippets


set_time_limit(0);
HP;

$account = new ShadPHP(989123456789); // Only without zero and with area code 98
$account->onUpdate(function (array $update) use ($account) {
    if (isset($update['data_enc'])) {
        $message = $update['data_enc'];
        // other code
    }
});


$account->getUserGUID();

$account->getChats(); // get all of chats

$account->getChatAds(); // get all of chats ads

$account->getChatsUpdates(); // get chat updates

$account->getMySessions(); // get all of account session

$account->getUserInfo($user_guid);

$account->getGroupInfo($group_guid);

$account->getChannelInfo($channel_guid);

$account->getAbsObjects($objects_guids);

$account->getMessagesInterval($object_guid, $middle_message_id); // get message content by message id

$account->getMessagesUpdates($object_guid);

$account->getMessages($object_guid, $sort, $filter_type, $max_id);

$account->getMessagesByID($object_guid, $message_ids);

$account->getPollStatus($poll_id);

$account->seenChats($seen_list);

$account->searchChatMessages($search_text, $type, $object_guid);

$account->searchGlobalObjects($search_text);

$account->searchGlobalMessages($search_text, $type);

$account->sendMessage($object_guid, $text);

$account->votePoll($poll_id, $selection_index);

$account->uploadFile($object_guid, $file_path, $text, $progress_cb);

$account->downloadFile($file_inline, $save_file, $overwrite, $progress_cb);


composer