Compare commits

..

6 Commits

Author SHA1 Message Date
Jerry Ma
c51c96c6cf
Update composer.json 2024-10-01 23:04:13 +08:00
Jerry Ma
740ea2b4f9
Update composer.json 2024-10-01 23:03:58 +08:00
Jerry Ma
d83b1aaf2d
Update zmplugin.json 2024-10-01 23:03:37 +08:00
Jerry Ma
45f144477f
Update GocqSegmentConverter.php 2024-10-01 23:03:17 +08:00
Jerry Ma
0137baff4c
Merge pull request #3 from DreamMiu/master
Update GocqAdapter.php
2023-05-21 14:52:04 +08:00
Miu
1e53aba257
Update GocqAdapter.php
他会认为非ob12都提示为ob11,实际上他可能有更多的可能
2023-05-21 03:30:00 +08:00
4 changed files with 5 additions and 4 deletions

View File

@ -7,13 +7,13 @@
}
},
"require": {
"php": "~8.0 || ~8.1 || ~8.2"
"php": "~8.0 || ~8.1 || ~8.2 || ~8.3"
},
"require-dev": {
"zhamao/framework": "dev-main"
},
"minimum-stability": "dev",
"extra": {
"zm-plugin-version": "1.0.0"
"zm-plugin-version": "1.1.1"
}
}

View File

@ -50,7 +50,6 @@ class GocqAdapter
#[BindEvent(WebSocketOpenEvent::class)]
public function handleWSReverseOpen(WebSocketOpenEvent $event): void
{
logger()->info('连接到 ob11');
$request = $event->getRequest();
// 判断是不是 Gocq 或 OneBot 11 标准的连接。OB11 标准必须带有 X-Client-Role 和 X-Self-ID 两个头。
if ($request->getHeaderLine('X-Client-Role') === 'Universal' && $request->getHeaderLine('X-Self-ID') !== '') {

View File

@ -76,6 +76,8 @@ class GocqSegmentConverter
public function parseSegment11To12(string $type, array $data): array
{
switch ($type) {
case 'text':
return [$type, $data];
case 'at':
$qq = $data['qq'];
unset($data['qq']);

View File

@ -1,5 +1,5 @@
{
"name": "go-cqhttp-adapter-plugin",
"version": "1.0.0",
"version": "1.1.1",
"main": "main.php"
}