Files
zhamao-framework/src/ZM/API/ZMRobot.php

39 lines
994 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
2020-08-31 10:11:06 +08:00
namespace ZM\API;
2022-04-04 00:11:58 +08:00
use ZM\API\Proxies\Bot as Proxies;
use ZM\Console\Console;
/**
* Class ZMRobot
* @since 1.2
2020-09-29 15:07:43 +08:00
* @version V11
*/
2021-06-16 00:17:30 +08:00
class ZMRobot extends OneBotV11
{
2022-04-04 00:11:58 +08:00
/**
* 获取一个会在所有机器人实例上执行的代理
*/
public function all(Proxies\AbstractBotProxy $proxy = null): Proxies\AllBotsProxy
{
$bot = $proxy ?: $this;
$bot_id = implode_when_necessary($bot->getSelfId());
Console::debug("Constructing AllBotsProxy for ZMRobot({$bot_id})");
return new Proxies\AllBotsProxy($bot);
}
/**
* 获取一个会在所有群上执行的代理
*/
public function allGroups(Proxies\AbstractBotProxy $proxy = null): Proxies\AllGroupsProxy
{
$bot = $proxy ?: $this;
$bot_id = implode_when_necessary($bot->getSelfId());
Console::debug("Constructing AllGroupsProxy for ZMRobot({$bot_id})");
return new Proxies\AllGroupsProxy($bot);
}
}