RBot - 辅助函数

发表:2年前 更新:1年前

常用的辅助函数只有: sendMsgsendDatahttp

sendMsg

请求 go-cqhttp 的 api,但是不返回接口响应数据

sendMsg(array $data, string $action,$response_type="array")

$data 传入请求参数

$action 传入终结点(前面不加/)

举个例子

给 qq 1234567 发送你好

sendMsg([
	"user_id" => 1234567,
	"message" => "你好"
],'send_private_msg');

sendData

请求 go-cqhttp 的 api,并返回接口响应数据

sendData(array $data, string $action,$response_type="array"):: \GuzzleHttp\Promise\PromiseInterface|array|string|\Psr\Http\Message\ResponseInterface|\Overtrue\Http\Support\Collection

$data 传入请求参数

$action 传入终结点(前面不加/)

举个例子

给 qq 1234567 发送你好

sendData([
	"user_id" => 1234567,
	"message" => "你好"
],'send_private_msg');

http

Overtrue\Http\Client

的实例

具体文档 https://github.com/overtrue/http

举个例子

return http()->get("https://github-api.inkedus.workers.dev/");
signature
保持理智
评论

无权限

请登录后评论

RunPod公众号

赞助商

联系我们

QQ群:798695907

邮箱:laravel@88.com