arjomand / eitaa
用于操作 Eitaayar API 的轻量级库
1.0.0
2023-05-25 05:30 UTC
Requires
- php: ^5.6 | ^7.0 | ^8.0
- curl/curl: 2.*
This package is auto-updated.
Last update: 2024-09-29 22:48:32 UTC
README
EitaaPHP 是一个用于在 PHP 中操作 Eitaayar API 的轻量级库
如何将其添加到我的项目中?
1. 使用 composer
$ composer require arjomand/eitaa
2. 使用 git
$ git clone https://github.com/mohammadali-arjomand/eitaaphplib.git
注意
如果你使用 git 将库添加到你的项目中,你也需要在项目中添加 cURL
现在你应该包含库文件
include "eitaa.php";
如何使用它?
为了使用这个库
- 首先,从这里找到你的 eitaa token 和 channel id。
$token = "bot16344:6d3e4430-****-****-****-************"; $channel_id = 23333622;
- 现在,从 Eitaa 类创建一个对象。
$eitaa = new EitaaPHP($token, $channel_id);
- 使用 sendMessage 或 sendFile 方法发送。
// send message $eitaa->sendMessgae("YOUR_TEXT_TO_SEND"); // send file $eitaa->sendFile("YOUR_FILE_PATH_TO_SEND");
- 你可以在方法中使用其他参数(见其他参数文档:
~/docs/other-argument.md
)。
// send message $eitaa->sendMessgae("YOUR_TEXT_TO_SEND", [OTHER_PARAMETER => "VALUE"]); // send file $eitaa->sendFile("YOUR_FILE_PATH_TO_SEND", [OTHER_PARAMETER => "VALUE"]);
示例
你可以在
~/examples
中看到示例代码