mirror of
https://github.com/zhamao-robot/go-cqhttp-adapter-plugin.git
synced 2026-03-18 04:34:51 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c51c96c6cf | ||
|
|
740ea2b4f9 | ||
|
|
d83b1aaf2d | ||
|
|
45f144477f | ||
|
|
0137baff4c | ||
|
|
1e53aba257 |
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@ -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') !== '') {
|
||||
|
||||
@ -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']);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "go-cqhttp-adapter-plugin",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.1",
|
||||
"main": "main.php"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user