bahramali / shad-php
Shad-PHP 是一个用于与 Shad(学生教育网络)交互的 PHP 库
v1.0.0
2021-04-27 10:00 UTC
Requires
- php: >=7.2
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- ext-openssl: *
- textalk/websocket: ^1.5
README
Shad-PHP
Shad-PHP 是一个用于与 Shad(学生教育网络)交互的 PHP 库
安装
composer require bahramali/shad-php
使用
object_guid($user_guid,$group_guid,$channel_guid 等) 是用户、组、频道等的唯一代码
set_time_limit(0); require_once __DIR__ . '/vendor/autoload.php'; use ShadPHP\ShadPHP; $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);
示例
关于我们
这个库可以像官方应用一样轻松地与 Shad 交互。
免责声明
此库免费,不得出售。
使用此库的责任由个人承担
许可
Shad-PHP 在 MIT 许可证下授权 - 有关详细信息,请参阅LICENSE 文件