-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChatNio.php
52 lines (44 loc) · 1.13 KB
/
ChatNio.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
namespace com\hujiayucc\chatnio;
require_once __DIR__ . "/data/Pets.php";
require_once __DIR__ ."/data/Subscribe.php";
require_once __DIR__ . "/data/Tasks.php";
use com\hujiayucc\chatnio\data\Pets;
use com\hujiayucc\chatnio\data\Subscribe;
use com\hujiayucc\chatnio\data\Tasks;
/** Use PHP Version 7.4+ */
class ChatNio
{
/** @var string API地址 */
public static string $API;
private Pets $pets;
private Tasks $tasks;
private Subscribe $subscribe;
/**
* 创建一个ChatNio
* @param string $key 秘钥
* @param string $point API节点
*/
public function __construct(string $key, string $point = "https://api.chatnio.net")
{
ChatNio::$API = $point;
$this->pets = new Pets($key);
$this->tasks = new Tasks($key);
$this->subscribe = new Subscribe($key);
}
/** 余额 */
public function Pets(): Pets
{
return $this->pets;
}
/** 对话 */
public function Tasks(): Tasks
{
return $this->tasks;
}
/** 订阅和礼包 */
public function Subscribe(): Subscribe
{
return $this->subscribe;
}
}