mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Compare commits
39 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
99b504b5f6 | ||
![]() |
1146454fec | ||
![]() |
805e014a75 | ||
![]() |
d3acd1efc1 | ||
![]() |
9fcd218a5a | ||
![]() |
d6a0830cfe | ||
![]() |
40a63b9c66 | ||
![]() |
eeb19a04cc | ||
![]() |
91e457eb03 | ||
![]() |
78d1919d7f | ||
![]() |
8393acf173 | ||
![]() |
bca152a047 | ||
![]() |
6a15908a93 | ||
![]() |
c626bbab74 | ||
![]() |
c5c7dcc6f2 | ||
![]() |
03dafe727e | ||
![]() |
744921c45e | ||
![]() |
abc4a4dcba | ||
![]() |
7e0da2f929 | ||
![]() |
a3b70d0f1f | ||
![]() |
d291724f06 | ||
![]() |
122a9ca2cc | ||
![]() |
48aaddd32b | ||
![]() |
47401af856 | ||
![]() |
709adfd812 | ||
![]() |
038d0c5412 | ||
![]() |
6bb4362ed4 | ||
![]() |
e617f9452d | ||
![]() |
6d8bb49a37 | ||
![]() |
4f6073ee86 | ||
![]() |
2e7176304b | ||
![]() |
e36cf11004 | ||
![]() |
0e49e17f68 | ||
![]() |
524de45f6b | ||
![]() |
85741a4b60 | ||
![]() |
f9ccb8c978 | ||
![]() |
ea3d069e49 | ||
![]() |
3e6024f183 | ||
![]() |
337871693a |
115
.vscode/launch.json
vendored
Normal file
115
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "dev:shell",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"dev:shell"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "build:shell",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"build:shell"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "build:universal",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"build:universal"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "build:framework",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"build:framework"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "build:webui",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"build:webui"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "dev:universal",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"dev:universal"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "dev:framework",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"dev:framework"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "dev:webui",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"dev:webui"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "lint",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"lint"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "depend",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"depend"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "dev:depend",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"dev:depend"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
83
README.md
83
README.md
@@ -1,67 +1,62 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
|
# NapCat
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
_Modern protocol-side framework implemented based on NTQQ._
|
||||||
|
|
||||||
|
> 云起兮风生,心向远方兮路未曾至.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
---
|
---
|
||||||
## 欢迎回家
|
|
||||||
NapCatQQ 是现代化的基于 NTQQ 的 Bot 协议端实现
|
|
||||||
|
|
||||||
## 特性介绍
|
## Welcome
|
||||||
- [x] **安装简单**:就算是笨蛋也能使用
|
+ NapCatQQ is a modern implementation of the Bot protocol based on NTQQ.
|
||||||
- [x] **性能友好**:就算是低内存也能使用
|
- NapCatQQ 是现代化的基于 NTQQ 的 Bot 协议端实现
|
||||||
- [x] **接口丰富**:就算是没有也能使用
|
|
||||||
- [x] **稳定好用**:就算是被捉也能使用
|
|
||||||
|
|
||||||
## 使用框架
|
## Feature
|
||||||
|
|
||||||
|
+ **Easy to Use**
|
||||||
|
- 作为初学者能够轻松使用.
|
||||||
|
+ **Quick and Efficient**
|
||||||
|
- 在低内存操作系统长时运行.
|
||||||
|
+ **Rich API Interface**
|
||||||
|
- 完整实现了大部分标准接口.
|
||||||
|
+ **Stable and Reliable**
|
||||||
|
- 持续稳定的开发与维护.
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
可前往 [Release](https://github.com/NapNeko/NapCatQQ/releases/) 页面下载最新版本
|
可前往 [Release](https://github.com/NapNeko/NapCatQQ/releases/) 页面下载最新版本
|
||||||
|
|
||||||
**首次使用**请务必查看如下文档看使用教程
|
**首次使用**请务必查看如下文档看使用教程
|
||||||
|
|
||||||
### 文档地址
|
## Link
|
||||||
|
|
||||||
[Cloudflare.Worker](https://doc.napneko.icu/)
|
| Docs | [](https://napneko.github.io/) | [](https://doc.napneko.icu/) | [](https://napcat.napneko.icu/) |
|
||||||
|
|:-:|:-:|:-:|:-:|
|
||||||
|
|
||||||
[Cloudflare.HKServer](https://napcat.napneko.icu/)
|
| Docs | [](https://napneko.pages.dev/) | [](https://docs.napcat.cyou/) | [](https://www.napcat.wiki) |
|
||||||
|
|:-:|:-:|:-:|:-:|
|
||||||
|
|
||||||
[Github.IO](https://napneko.github.io/)
|
| Contact | [](https://qm.qq.com/q/I6LU87a0Yq) | [](https://qm.qq.com/q/HaRcfrHpUk) | [](https://t.me/MelodicMoonlight) |
|
||||||
|
|:-:|:-:|:-:|:-:|
|
||||||
|
|
||||||
[Cloudflare.Pages](https://napneko.pages.dev/)
|
## Thanks
|
||||||
|
|
||||||
[Server.Other](https://docs.napcat.cyou/)
|
+ [Lagrange](https://github.com/LagrangeDev/Lagrange.Core) 对本项目的大力支持 参考部分代码 已获授权
|
||||||
|
|
||||||
[NapCat.Wiki](https://www.napcat.wiki)
|
+ [LLOneBot](https://github.com/LLOneBot/LLOneBot) 相关的开发曾参与本项目部分开发
|
||||||
|
|
||||||
## 回家旅途
|
+ 不过最最重要的 还是需要感谢屏幕前的你哦~
|
||||||
[QQ Group#1](https://qm.qq.com/q/I6LU87a0Yq)
|
|
||||||
|
|
||||||
[QQ Group#2](https://qm.qq.com/q/HaRcfrHpUk)
|
|
||||||
|
|
||||||
[Telegram](https://t.me/MelodicMoonlight)
|
|
||||||
|
|
||||||
> QQ Group#2 准许Bot / Telegram与QQ Group#2 为新建Group
|
|
||||||
|
|
||||||
## 性能设计/协议标准
|
|
||||||
NapCat 已实现90%+的 OneBot / GoCQ 标准接口,并提供兼容性保留接口,其设计理念遵守 无数据库/异步优先/后台刷新 的性能思想。
|
|
||||||
|
|
||||||
由此设计带来一系列好处,在开发中,获取群员列表通常小于50Ms,单条文本消息发送在320Ms以内,在1k+的群聊流畅运行,同时带来一些副作用,消息Id无法持久,无法上报撤回消息原始内容。
|
|
||||||
|
|
||||||
NapCat 在设计理念下遵守 OneBot 规范大多数要求并且积极改进,任何合理的标准化 Issue 与 Pr 将被接收。
|
|
||||||
|
|
||||||
## 感谢他们
|
|
||||||
感谢 [Lagrange](https://github.com/LagrangeDev/Lagrange.Core) 对本项目的大力支持 参考部分代码 已获授权
|
|
||||||
|
|
||||||
感谢 React 强力驱动 NapCat.WebUi
|
|
||||||
|
|
||||||
不过最最重要的 还是需要感谢屏幕前的你哦~
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 特殊感谢
|
## License
|
||||||
[LLOneBot](https://github.com/LLOneBot/LLOneBot) 相关的开发曾参与本项目
|
本项目采用 混合协议 开源,因此使用本项目时,你需要注意以下几点:
|
||||||
|
1. 第三方库代码或修改部分遵循其原始开源许可.
|
||||||
|
2. 本项目获取部分项目授权而不受部分约束
|
||||||
|
2. 项目其余逻辑代码采用[本仓库开源许可](./LICENSE).
|
||||||
|
|
||||||
## 开源附加
|
**本仓库仅用于提高易用性,实现消息推送类功能,此外,禁止任何项目未经仓库主作者授权基于 NapCat 代码开发。使用请遵守当地法律法规,由此造成的问题由使用者和提供违规使用教程者负责。**
|
||||||
|
|
||||||
任何使用本仓库代码的地方,都应当严格遵守[本仓库开源许可](./LICENSE)。**本仓库仅用于提高易用性,实现消息推送类功能,此外,禁止任何项目未经仓库主作者授权基于 NapCat 代码开发。使用请遵守当地法律法规,由此造成的问题由使用者和提供违规使用教程者负责。**
|
|
||||||
|
BIN
external/LiteLoaderWrapper.zip
vendored
BIN
external/LiteLoaderWrapper.zip
vendored
Binary file not shown.
@@ -19,7 +19,7 @@ for %%a in ("%RetString%") do (
|
|||||||
SET QQPath=%pathWithoutUninstall%QQ.exe
|
SET QQPath=%pathWithoutUninstall%QQ.exe
|
||||||
|
|
||||||
if not exist "%QQpath%" (
|
if not exist "%QQpath%" (
|
||||||
echo provided QQ path is invalid: %QQpath%
|
echo provided QQ path is invalid
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
@@ -19,7 +19,7 @@ for %%a in ("%RetString%") do (
|
|||||||
SET QQPath=%pathWithoutUninstall%QQ.exe
|
SET QQPath=%pathWithoutUninstall%QQ.exe
|
||||||
|
|
||||||
if not exist "%QQpath%" (
|
if not exist "%QQpath%" (
|
||||||
echo provided QQ path is invalid: %QQpath%
|
echo provided QQ path is invalid
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
@@ -27,8 +27,8 @@ for %%a in ("%RetString%") do (
|
|||||||
|
|
||||||
SET QQPath=%pathWithoutUninstall%QQ.exe
|
SET QQPath=%pathWithoutUninstall%QQ.exe
|
||||||
|
|
||||||
if not exist "%QQpath%" (
|
if not exist "%QQPath%" (
|
||||||
echo provided QQ path is invalid: %QQpath%
|
echo provided QQ path is invalid
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
@@ -27,8 +27,8 @@ for %%a in ("%RetString%") do (
|
|||||||
|
|
||||||
SET QQPath=%pathWithoutUninstall%QQ.exe
|
SET QQPath=%pathWithoutUninstall%QQ.exe
|
||||||
|
|
||||||
if not exist "%QQpath%" (
|
if not exist "%QQPath%" (
|
||||||
echo provided QQ path is invalid: %QQpath%
|
echo provided QQ path is invalid
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
@@ -1,10 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "qq-chat",
|
"name": "qq-chat",
|
||||||
"version": "9.9.17-30899",
|
"version": "9.9.18-32793",
|
||||||
"verHash": "ececf273",
|
"verHash": "d43f097e",
|
||||||
"linuxVersion": "3.2.15-30899",
|
"linuxVersion": "3.2.16-32793",
|
||||||
"linuxVerHash": "63c751e8",
|
"linuxVerHash": "ee4bd910",
|
||||||
"type": "module",
|
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "QQ",
|
"description": "QQ",
|
||||||
"productName": "QQ",
|
"productName": "QQ",
|
||||||
@@ -17,10 +16,27 @@
|
|||||||
"bin": {
|
"bin": {
|
||||||
"qd": "externals/devtools/cli/index.js"
|
"qd": "externals/devtools/cli/index.js"
|
||||||
},
|
},
|
||||||
|
"appid": {
|
||||||
|
"win32": "537258389",
|
||||||
|
"darwin": "537258412",
|
||||||
|
"linux": "537258424"
|
||||||
|
},
|
||||||
"main": "./loadNapCat.js",
|
"main": "./loadNapCat.js",
|
||||||
"buildVersion": "30899",
|
"peerDependenciesMeta": {
|
||||||
|
"*": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pnpm": {
|
||||||
|
"patchedDependencies": {
|
||||||
|
"@vue/runtime-dom@3.5.12": "patches/@vue__runtime-dom@3.5.12.patch",
|
||||||
|
"@swc/helpers@0.5.3": "patches/@swc__helpers@0.5.3.patch",
|
||||||
|
"vuex@4.1.0": "patches/vuex@4.1.0.patch"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"buildVersion": "32793",
|
||||||
"isPureShell": true,
|
"isPureShell": true,
|
||||||
"isByteCodeShell": true,
|
"isByteCodeShell": true,
|
||||||
"platform": "win32",
|
"platform": "win32",
|
||||||
"eleArch": "x64"
|
"eleArch": "x64"
|
||||||
}
|
}
|
@@ -4,7 +4,7 @@
|
|||||||
"name": "NapCatQQ",
|
"name": "NapCatQQ",
|
||||||
"slug": "NapCat.Framework",
|
"slug": "NapCat.Framework",
|
||||||
"description": "高性能的 OneBot 11 协议实现",
|
"description": "高性能的 OneBot 11 协议实现",
|
||||||
"version": "4.5.23",
|
"version": "4.6.9",
|
||||||
"icon": "./logo.png",
|
"icon": "./logo.png",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
@@ -136,7 +136,7 @@ const OneBotApiDebug: React.FC<OneBotApiDebugProps> = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<Card
|
<Card
|
||||||
shadow="sm"
|
shadow="sm"
|
||||||
className="my-4 bg-opacity-50 backdrop-blur-md overflow-visible z-20"
|
className="my-4 bg-opacity-50 backdrop-blur-md overflow-visible"
|
||||||
>
|
>
|
||||||
<CardHeader className="font-bold text-lg gap-1 pb-0">
|
<CardHeader className="font-bold text-lg gap-1 pb-0">
|
||||||
<span className="mr-2">请求体</span>
|
<span className="mr-2">请求体</span>
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
"name": "napcat",
|
"name": "napcat",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "4.5.23",
|
"version": "4.6.9",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:universal": "npm run build:webui && vite build --mode universal || exit 1",
|
"build:universal": "npm run build:webui && vite build --mode universal || exit 1",
|
||||||
"build:framework": "npm run build:webui && vite build --mode framework || exit 1",
|
"build:framework": "npm run build:webui && vite build --mode framework || exit 1",
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
"express-rate-limit": "^7.5.0",
|
"express-rate-limit": "^7.5.0",
|
||||||
"fast-xml-parser": "^4.3.6",
|
"fast-xml-parser": "^4.3.6",
|
||||||
"file-type": "^20.0.0",
|
"file-type": "^20.0.0",
|
||||||
"globals": "^15.12.0",
|
"globals": "^16.0.0",
|
||||||
"image-size": "^1.1.1",
|
"image-size": "^1.1.1",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"multer": "^1.4.5-lts.1",
|
"multer": "^1.4.5-lts.1",
|
||||||
|
@@ -163,7 +163,7 @@ class Store {
|
|||||||
const current = this.get<StoreValueType>(key);
|
const current = this.get<StoreValueType>(key);
|
||||||
|
|
||||||
if (current === null) {
|
if (current === null) {
|
||||||
this.set(key, 1);
|
this.set(key, 1, 60);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@ class Store {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const newValue = numericValue + 1;
|
const newValue = numericValue + 1;
|
||||||
this.set(key, newValue);
|
this.set(key, newValue, 60);
|
||||||
return newValue;
|
return newValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1 +1 @@
|
|||||||
export const napCatVersion = '4.5.23';
|
export const napCatVersion = '4.6.9';
|
||||||
|
@@ -42,7 +42,7 @@ export class NTQQFileApi {
|
|||||||
this.core = core;
|
this.core = core;
|
||||||
this.rkeyManager = new RkeyManager([
|
this.rkeyManager = new RkeyManager([
|
||||||
'https://ss.xingzhige.com/music_card/rkey', // 国内
|
'https://ss.xingzhige.com/music_card/rkey', // 国内
|
||||||
'https://rkey.napneko.icu/rkeys' // Cloudflare
|
'https://secret-service.bietiaop.com/rkeys',//国内
|
||||||
],
|
],
|
||||||
this.context.logger
|
this.context.logger
|
||||||
);
|
);
|
||||||
|
@@ -27,6 +27,9 @@ export class NTQQGroupApi {
|
|||||||
this.core = core;
|
this.core = core;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async setGroupRemark(groupCode: string, remark: string) {
|
||||||
|
return this.context.session.getGroupService().modifyGroupRemark(groupCode, remark);
|
||||||
|
}
|
||||||
async fetchGroupDetail(groupCode: string) {
|
async fetchGroupDetail(groupCode: string) {
|
||||||
const [, detailInfo] = await this.core.eventWrapper.callNormalEventV2(
|
const [, detailInfo] = await this.core.eventWrapper.callNormalEventV2(
|
||||||
'NodeIKernelGroupService/getGroupDetailInfo',
|
'NodeIKernelGroupService/getGroupDetailInfo',
|
||||||
@@ -345,9 +348,9 @@ export class NTQQGroupApi {
|
|||||||
return this.context.session.getGroupService().uploadGroupBulletinPic(groupCode, _Pskey, imageurl);
|
return this.context.session.getGroupService().uploadGroupBulletinPic(groupCode, _Pskey, imageurl);
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleGroupRequest(notify: GroupNotify, operateType: NTGroupRequestOperateTypes, reason?: string) {
|
async handleGroupRequest(doubt: boolean, notify: GroupNotify, operateType: NTGroupRequestOperateTypes, reason?: string) {
|
||||||
return this.context.session.getGroupService().operateSysNotify(
|
return this.context.session.getGroupService().operateSysNotify(
|
||||||
false,
|
doubt,
|
||||||
{
|
{
|
||||||
operateType: operateType,
|
operateType: operateType,
|
||||||
targetMsg: {
|
targetMsg: {
|
||||||
|
@@ -136,6 +136,20 @@ export class NTQQMsgApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async queryFirstMsgBySender(peer: Peer, SendersUid: string[]) {
|
||||||
|
console.log(peer, SendersUid);
|
||||||
|
return await this.context.session.getMsgService().queryMsgsWithFilterEx('0', '0', '0', {
|
||||||
|
chatInfo: peer,
|
||||||
|
filterMsgType: [],
|
||||||
|
filterSendersUid: SendersUid,
|
||||||
|
filterMsgToTime: '0',
|
||||||
|
filterMsgFromTime: '0',
|
||||||
|
isReverseOrder: true,
|
||||||
|
isIncludeCurrent: true,
|
||||||
|
pageLimit: 20000,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async setMsgRead(peer: Peer) {
|
async setMsgRead(peer: Peer) {
|
||||||
return this.context.session.getMsgService().setMsgRead(peer);
|
return this.context.session.getMsgService().setMsgRead(peer);
|
||||||
}
|
}
|
||||||
|
34
src/core/external/appid.json
vendored
34
src/core/external/appid.json
vendored
@@ -186,5 +186,37 @@
|
|||||||
"9.9.17-31363": {
|
"9.9.17-31363": {
|
||||||
"appid": 537266500,
|
"appid": 537266500,
|
||||||
"qua": "V1_WIN_NQ_9.9.17_31363_GW_B"
|
"qua": "V1_WIN_NQ_9.9.17_31363_GW_B"
|
||||||
|
},
|
||||||
|
"3.2.16-32690": {
|
||||||
|
"appid": 537271229,
|
||||||
|
"qua": "V1_LNX_NQ_3.2.16_32690_GW_B"
|
||||||
|
},
|
||||||
|
"9.9.18-32690": {
|
||||||
|
"appid": 537271194,
|
||||||
|
"qua": "V1_WIN_NQ_9.9.18_32690_GW_B"
|
||||||
|
},
|
||||||
|
"6.9.66-32690": {
|
||||||
|
"appid": 537271218,
|
||||||
|
"qua": "V1_MAC_NQ_6.9.66_32690_GW_B"
|
||||||
|
},
|
||||||
|
"3.2.16-32721": {
|
||||||
|
"appid": 537271229,
|
||||||
|
"qua": "V1_LNX_NQ_3.2.16_32721_GW_B"
|
||||||
|
},
|
||||||
|
"9.9.18-32793": {
|
||||||
|
"appid": 537271244,
|
||||||
|
"qua": "V1_WIN_NQ_9.9.18_32793_GW_B"
|
||||||
|
},
|
||||||
|
"3.2.16-32793": {
|
||||||
|
"appid": 537271279,
|
||||||
|
"qua": "V1_LNX_NQ_3.2.16_32793_GW_B"
|
||||||
|
},
|
||||||
|
"3.2.16-32869": {
|
||||||
|
"appid": 537271329,
|
||||||
|
"qua": "V1_LNX_NQ_3.2.16_32869_GW_B"
|
||||||
|
},
|
||||||
|
"9.9.18-32869": {
|
||||||
|
"appid": 537271294,
|
||||||
|
"qua": "V1_WIN_NQ_9.9.18_32869_GW_B"
|
||||||
}
|
}
|
||||||
}
|
}
|
5
src/core/external/napcat.json
vendored
5
src/core/external/napcat.json
vendored
@@ -4,5 +4,6 @@
|
|||||||
"fileLogLevel": "debug",
|
"fileLogLevel": "debug",
|
||||||
"consoleLogLevel": "info",
|
"consoleLogLevel": "info",
|
||||||
"packetBackend": "auto",
|
"packetBackend": "auto",
|
||||||
"packetServer": ""
|
"packetServer": "",
|
||||||
}
|
"o3HookMode": 1
|
||||||
|
}
|
46
src/core/external/offset.json
vendored
46
src/core/external/offset.json
vendored
@@ -246,5 +246,49 @@
|
|||||||
"6.9.65-31363-arm64": {
|
"6.9.65-31363-arm64": {
|
||||||
"send": "422CEF8",
|
"send": "422CEF8",
|
||||||
"recv": "422F710"
|
"recv": "422F710"
|
||||||
|
},
|
||||||
|
"9.9.18-32690-x64": {
|
||||||
|
"send": "39F9630",
|
||||||
|
"recv": "39FDE30"
|
||||||
|
},
|
||||||
|
"3.2.16-32690-x64": {
|
||||||
|
"send": "A5E24C0",
|
||||||
|
"recv": "A5E5EE0"
|
||||||
|
},
|
||||||
|
"3.2.16-32690-arm64": {
|
||||||
|
"send": "7226630",
|
||||||
|
"recv": "7229F60"
|
||||||
|
},
|
||||||
|
"3.2.16-32721-x64": {
|
||||||
|
"send": "A5E24C0",
|
||||||
|
"recv": "A5E5EE0"
|
||||||
|
},
|
||||||
|
"3.2.16-32721-arm64": {
|
||||||
|
"send": "7226630",
|
||||||
|
"recv": "7229F60"
|
||||||
|
},
|
||||||
|
"9.9.18-32793-x64": {
|
||||||
|
"send": "39F9A30",
|
||||||
|
"recv": "39FE230"
|
||||||
|
},
|
||||||
|
"3.2.16-32793-x64": {
|
||||||
|
"send": "A5E24C0",
|
||||||
|
"recv": "A5E5EE0"
|
||||||
|
},
|
||||||
|
"3.2.16-32793-arm64": {
|
||||||
|
"send": "7226630",
|
||||||
|
"recv": "7229F60"
|
||||||
|
},
|
||||||
|
"9.9.18-32869-x64": {
|
||||||
|
"send": "39F9A30",
|
||||||
|
"recv": "39FE230"
|
||||||
|
},
|
||||||
|
"3.2.16-32869-x64": {
|
||||||
|
"send": "A5E24C0",
|
||||||
|
"recv": "A5E5EE0"
|
||||||
|
},
|
||||||
|
"3.2.16-32869-arm64": {
|
||||||
|
"send": "7226630",
|
||||||
|
"recv": "7229F60"
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -10,6 +10,7 @@ export const NapcatConfigSchema = Type.Object({
|
|||||||
consoleLogLevel: Type.String({ default: 'info' }),
|
consoleLogLevel: Type.String({ default: 'info' }),
|
||||||
packetBackend: Type.String({ default: 'auto' }),
|
packetBackend: Type.String({ default: 'auto' }),
|
||||||
packetServer: Type.String({ default: '' }),
|
packetServer: Type.String({ default: '' }),
|
||||||
|
o3HookMode: Type.Number({ default: 0 }),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type NapcatConfig = Static<typeof NapcatConfigSchema>;
|
export type NapcatConfig = Static<typeof NapcatConfigSchema>;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { ChatType } from '@/core';
|
import { ChatType, RawMessage } from '@/core';
|
||||||
export interface SearchGroupInfo {
|
export interface SearchGroupInfo {
|
||||||
groupCode: string;
|
groupCode: string;
|
||||||
ownerUid: string;
|
ownerUid: string;
|
||||||
@@ -56,7 +56,7 @@ export interface GroupSearchResult {
|
|||||||
nextPos: number;
|
nextPos: number;
|
||||||
}
|
}
|
||||||
export interface NodeIKernelSearchListener {
|
export interface NodeIKernelSearchListener {
|
||||||
|
|
||||||
onSearchGroupResult(params: GroupSearchResult): any;
|
onSearchGroupResult(params: GroupSearchResult): any;
|
||||||
|
|
||||||
onSearchFileKeywordsResult(params: {
|
onSearchFileKeywordsResult(params: {
|
||||||
@@ -94,4 +94,27 @@ export interface NodeIKernelSearchListener {
|
|||||||
}[]
|
}[]
|
||||||
}[]
|
}[]
|
||||||
}): any;
|
}): any;
|
||||||
|
|
||||||
|
onSearchMsgKeywordsResult(params: {
|
||||||
|
searchId: string,
|
||||||
|
hasMore: boolean,
|
||||||
|
resultItems: Array<{
|
||||||
|
msgId: string,
|
||||||
|
msgSeq: string,
|
||||||
|
msgTime: string,
|
||||||
|
senderUid: string,
|
||||||
|
senderUin: string,
|
||||||
|
senderNick: string,
|
||||||
|
senderNickHits: unknown[],
|
||||||
|
senderRemark: string,
|
||||||
|
senderRemarkHits: unknown[],
|
||||||
|
senderCard: string,
|
||||||
|
senderCardHits: unknown[],
|
||||||
|
fieldType: number,
|
||||||
|
fieldText: string,
|
||||||
|
msgRecord: RawMessage;
|
||||||
|
hitsInfo: Array<unknown>,
|
||||||
|
msgAbstract: unknown,
|
||||||
|
}>
|
||||||
|
}): void | Promise<void>;
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,7 @@ import { PacketLogger } from '@/core/packet/context/loggerContext';
|
|||||||
|
|
||||||
// 0 send 1 recv
|
// 0 send 1 recv
|
||||||
export interface NativePacketExportType {
|
export interface NativePacketExportType {
|
||||||
InitHook?: (send: string, recv: string, callback: (type: number, uin: string, cmd: string, seq: number, hex_data: string) => void) => boolean;
|
InitHook?: (send: string, recv: string, callback: (type: number, uin: string, cmd: string, seq: number, hex_data: string) => void, o3_hook: boolean) => boolean;
|
||||||
SendPacket?: (cmd: string, data: string, trace_id: string) => void;
|
SendPacket?: (cmd: string, data: string, trace_id: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,6 +42,7 @@ export class NativePacketClient extends IPacketClient {
|
|||||||
const platform = process.platform + '.' + process.arch;
|
const platform = process.platform + '.' + process.arch;
|
||||||
const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './moehoo/MoeHoo.' + platform + '.node');
|
const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './moehoo/MoeHoo.' + platform + '.node');
|
||||||
process.dlopen(this.MoeHooExport, moehoo_path, constants.dlopen.RTLD_LAZY);
|
process.dlopen(this.MoeHooExport, moehoo_path, constants.dlopen.RTLD_LAZY);
|
||||||
|
|
||||||
this.MoeHooExport.exports.InitHook?.(send, recv, (type: number, uin: string, cmd: string, seq: number, hex_data: string) => {
|
this.MoeHooExport.exports.InitHook?.(send, recv, (type: number, uin: string, cmd: string, seq: number, hex_data: string) => {
|
||||||
const trace_id = createHash('md5').update(Buffer.from(hex_data, 'hex')).digest('hex');
|
const trace_id = createHash('md5').update(Buffer.from(hex_data, 'hex')).digest('hex');
|
||||||
if (type === 0 && this.cb.get(trace_id + 'recv')) {
|
if (type === 0 && this.cb.get(trace_id + 'recv')) {
|
||||||
@@ -55,7 +56,7 @@ export class NativePacketClient extends IPacketClient {
|
|||||||
// console.log('callback:', callback, trace_id);
|
// console.log('callback:', callback, trace_id);
|
||||||
callback?.({ seq, cmd, hex_data });
|
callback?.({ seq, cmd, hex_data });
|
||||||
}
|
}
|
||||||
});
|
}, this.napcore.config.o3HookMode == 1);
|
||||||
this.available = true;
|
this.available = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -165,7 +165,7 @@ export interface NodeIKernelGroupService {
|
|||||||
|
|
||||||
modifyGroupName(groupCode: string, groupName: string, isNormalMember: boolean): Promise<GeneralCallResult>;
|
modifyGroupName(groupCode: string, groupName: string, isNormalMember: boolean): Promise<GeneralCallResult>;
|
||||||
|
|
||||||
modifyGroupRemark(groupCode: string, remark: string): void;
|
modifyGroupRemark(groupCode: string, remark: string): Promise<GeneralCallResult>;
|
||||||
|
|
||||||
modifyGroupDetailInfo(groupCode: string, arg: unknown): void;
|
modifyGroupDetailInfo(groupCode: string, arg: unknown): void;
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { ChatType } from '@/core/types';
|
import { ChatType, Peer } from '@/core/types';
|
||||||
import { GeneralCallResult } from './common';
|
import { GeneralCallResult } from './common';
|
||||||
|
|
||||||
export interface NodeIKernelSearchService {
|
export interface NodeIKernelSearchService {
|
||||||
@@ -54,7 +54,7 @@ export interface NodeIKernelSearchService {
|
|||||||
|
|
||||||
cancelSearchChatMsgs(...args: unknown[]): unknown;// needs 3 arguments
|
cancelSearchChatMsgs(...args: unknown[]): unknown;// needs 3 arguments
|
||||||
|
|
||||||
searchMsgWithKeywords(...args: unknown[]): unknown;// needs 2 arguments
|
searchMsgWithKeywords(keyWords: string[], param: Peer & { searchFields: number, pageLimit: number }): Promise<GeneralCallResult>;
|
||||||
|
|
||||||
searchMoreMsgWithKeywords(...args: unknown[]): unknown;// needs 1 arguments
|
searchMoreMsgWithKeywords(...args: unknown[]): unknown;// needs 1 arguments
|
||||||
|
|
||||||
|
@@ -7,13 +7,13 @@ import { SelfInfo } from '@/core/types';
|
|||||||
import { NodeIKernelLoginListener } from '@/core/listeners';
|
import { NodeIKernelLoginListener } from '@/core/listeners';
|
||||||
import { NodeIKernelLoginService } from '@/core/services';
|
import { NodeIKernelLoginService } from '@/core/services';
|
||||||
import { NodeIQQNTWrapperSession, WrapperNodeApi } from '@/core/wrapper';
|
import { NodeIQQNTWrapperSession, WrapperNodeApi } from '@/core/wrapper';
|
||||||
import { InitWebUi, WebUiConfig } from '@/webui';
|
import { InitWebUi, WebUiConfig, webUiRuntimePort } from '@/webui';
|
||||||
import { NapCatOneBot11Adapter } from '@/onebot';
|
import { NapCatOneBot11Adapter } from '@/onebot';
|
||||||
|
|
||||||
//Framework ES入口文件
|
//Framework ES入口文件
|
||||||
export async function getWebUiUrl() {
|
export async function getWebUiUrl() {
|
||||||
const WebUiConfigData = (await WebUiConfig.GetWebUIConfig());
|
const WebUiConfigData = (await WebUiConfig.GetWebUIConfig());
|
||||||
return 'http://127.0.0.1:' + WebUiConfigData.port + '/webui/?token=' + WebUiConfigData.token;
|
return 'http://127.0.0.1:' + webUiRuntimePort + '/webui/?token=' + WebUiConfigData.token;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function NCoreInitFramework(
|
export async function NCoreInitFramework(
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
22
src/onebot/action/extends/SetGroupRemark.ts
Normal file
22
src/onebot/action/extends/SetGroupRemark.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
|
import { ActionName } from '@/onebot/action/router';
|
||||||
|
import { Static, Type } from '@sinclair/typebox';
|
||||||
|
|
||||||
|
const SchemaData = Type.Object({
|
||||||
|
group_id: Type.String(),
|
||||||
|
remark: Type.String(),
|
||||||
|
});
|
||||||
|
|
||||||
|
type Payload = Static<typeof SchemaData>;
|
||||||
|
|
||||||
|
export default class SetGroupRemark extends OneBotAction<Payload, null> {
|
||||||
|
override actionName = ActionName.SetGroupRemark;
|
||||||
|
override payloadSchema = SchemaData;
|
||||||
|
async _handle(payload: Payload): Promise<null> {
|
||||||
|
let ret = await this.core.apis.GroupApi.setGroupRemark(payload.group_id, payload.remark);
|
||||||
|
if (ret.result != 0) {
|
||||||
|
throw new Error(`设置群备注失败, ${ret.result}:${ret.errMsg}`);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@@ -5,7 +5,7 @@ import { Static, Type } from '@sinclair/typebox';
|
|||||||
const SchemaData = Type.Object({
|
const SchemaData = Type.Object({
|
||||||
group_id: Type.Union([Type.Number(), Type.String()]),
|
group_id: Type.Union([Type.Number(), Type.String()]),
|
||||||
user_id: Type.Union([Type.Number(), Type.String()]),
|
user_id: Type.Union([Type.Number(), Type.String()]),
|
||||||
special_title: Type.String(),
|
special_title: Type.String({ default: '' }),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = Static<typeof SchemaData>;
|
type Payload = Static<typeof SchemaData>;
|
||||||
@@ -16,7 +16,7 @@ export class SetSpecialTittle extends GetPacketStatusDepends<Payload, void> {
|
|||||||
|
|
||||||
async _handle(payload: Payload) {
|
async _handle(payload: Payload) {
|
||||||
const uid = await this.core.apis.UserApi.getUidByUinV2(payload.user_id.toString());
|
const uid = await this.core.apis.UserApi.getUidByUinV2(payload.user_id.toString());
|
||||||
if(!uid) throw new Error('User not found');
|
if (!uid) throw new Error('User not found');
|
||||||
await this.core.apis.PacketApi.pkt.operation.SetGroupSpecialTitle(+payload.group_id, uid, payload.special_title);
|
await this.core.apis.PacketApi.pkt.operation.SetGroupSpecialTitle(+payload.group_id, uid, payload.special_title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -20,11 +20,12 @@ export default class SetGroupAddRequest extends OneBotAction<Payload, null> {
|
|||||||
const approve = payload.approve?.toString() !== 'false';
|
const approve = payload.approve?.toString() !== 'false';
|
||||||
const reason = payload.reason ?? ' ';
|
const reason = payload.reason ?? ' ';
|
||||||
const invite_notify = this.obContext.apis.MsgApi.notifyGroupInvite.get(flag);
|
const invite_notify = this.obContext.apis.MsgApi.notifyGroupInvite.get(flag);
|
||||||
const notify = invite_notify ?? await this.findNotify(flag);
|
const { doubt, notify } = invite_notify ? { doubt: false, notify: invite_notify } : await this.findNotify(flag);
|
||||||
if (!notify) {
|
if (!notify) {
|
||||||
throw new Error('No such request');
|
throw new Error('No such request');
|
||||||
}
|
}
|
||||||
await this.core.apis.GroupApi.handleGroupRequest(
|
await this.core.apis.GroupApi.handleGroupRequest(
|
||||||
|
doubt,
|
||||||
notify,
|
notify,
|
||||||
approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
||||||
reason,
|
reason,
|
||||||
@@ -36,7 +37,8 @@ export default class SetGroupAddRequest extends OneBotAction<Payload, null> {
|
|||||||
let notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(false, 100)).find(e => e.seq == flag);
|
let notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(false, 100)).find(e => e.seq == flag);
|
||||||
if (!notify) {
|
if (!notify) {
|
||||||
notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(true, 100)).find(e => e.seq == flag);
|
notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(true, 100)).find(e => e.seq == flag);
|
||||||
|
return { doubt: true, notify };
|
||||||
}
|
}
|
||||||
return notify;
|
return { doubt: false, notify };
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -16,6 +16,8 @@ export default class SetGroupBan extends OneBotAction<Payload, null> {
|
|||||||
async _handle(payload: Payload): Promise<null> {
|
async _handle(payload: Payload): Promise<null> {
|
||||||
const uid = await this.core.apis.UserApi.getUidByUinV2(payload.user_id.toString());
|
const uid = await this.core.apis.UserApi.getUidByUinV2(payload.user_id.toString());
|
||||||
if (!uid) throw new Error('uid error');
|
if (!uid) throw new Error('uid error');
|
||||||
|
let member_role = (await this.core.apis.GroupApi.getGroupMemberEx(payload.group_id.toString(), uid, true))?.role;
|
||||||
|
if (member_role === 4) throw new Error('cannot ban owner');
|
||||||
// 例如无管理员权限时 result为 120101005 errMsg为 'ERR_NOT_GROUP_ADMIN'
|
// 例如无管理员权限时 result为 120101005 errMsg为 'ERR_NOT_GROUP_ADMIN'
|
||||||
let ret = await this.core.apis.GroupApi.banMember(payload.group_id.toString(),
|
let ret = await this.core.apis.GroupApi.banMember(payload.group_id.toString(),
|
||||||
[{ uid: uid, timeStamp: +payload.duration }]);
|
[{ uid: uid, timeStamp: +payload.duration }]);
|
||||||
|
@@ -108,10 +108,12 @@ import { BotExit } from './extends/BotExit';
|
|||||||
import { ClickInlineKeyboardButton } from './extends/ClickInlineKeyboardButton';
|
import { ClickInlineKeyboardButton } from './extends/ClickInlineKeyboardButton';
|
||||||
import { GetPrivateFileUrl } from './file/GetPrivateFileUrl';
|
import { GetPrivateFileUrl } from './file/GetPrivateFileUrl';
|
||||||
import { GetUnidirectionalFriendList } from './extends/GetUnidirectionalFriendList';
|
import { GetUnidirectionalFriendList } from './extends/GetUnidirectionalFriendList';
|
||||||
|
import SetGroupRemark from './extends/SetGroupRemark';
|
||||||
|
|
||||||
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
||||||
|
|
||||||
const actionHandlers = [
|
const actionHandlers = [
|
||||||
|
new SetGroupRemark(obContext, core),
|
||||||
new GetGroupInfoEx(obContext, core),
|
new GetGroupInfoEx(obContext, core),
|
||||||
new FetchEmojiLike(obContext, core),
|
new FetchEmojiLike(obContext, core),
|
||||||
new GetFile(obContext, core),
|
new GetFile(obContext, core),
|
||||||
@@ -227,8 +229,8 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo
|
|||||||
new GetGroupSystemMsg(obContext, core),
|
new GetGroupSystemMsg(obContext, core),
|
||||||
new BotExit(obContext, core),
|
new BotExit(obContext, core),
|
||||||
new ClickInlineKeyboardButton(obContext, core),
|
new ClickInlineKeyboardButton(obContext, core),
|
||||||
new GetPrivateFileUrl(obContext,core),
|
new GetPrivateFileUrl(obContext, core),
|
||||||
new GetUnidirectionalFriendList(obContext,core),
|
new GetUnidirectionalFriendList(obContext, core),
|
||||||
];
|
];
|
||||||
|
|
||||||
type HandlerUnion = typeof actionHandlers[number];
|
type HandlerUnion = typeof actionHandlers[number];
|
||||||
|
@@ -10,6 +10,7 @@ export interface InvalidCheckResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const ActionName = {
|
export const ActionName = {
|
||||||
|
SetGroupRemark: 'set_group_remark',
|
||||||
NapCat_GetPrivateFileUrl: 'get_private_file_url',
|
NapCat_GetPrivateFileUrl: 'get_private_file_url',
|
||||||
ClickInlineKeyboardButton: 'click_inline_keyboard_button',
|
ClickInlineKeyboardButton: 'click_inline_keyboard_button',
|
||||||
GetUnidirectionalFriendList: 'get_unidirectional_friend_list',
|
GetUnidirectionalFriendList: 'get_unidirectional_friend_list',
|
||||||
|
@@ -355,6 +355,7 @@ export class OneBotMsgApi {
|
|||||||
data: {
|
data: {
|
||||||
file: fileCode,
|
file: fileCode,
|
||||||
file_size: element.fileSize,
|
file_size: element.fileSize,
|
||||||
|
path: element.filePath,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -808,6 +809,7 @@ export class OneBotMsgApi {
|
|||||||
message_id: msg.id!,
|
message_id: msg.id!,
|
||||||
message_seq: msg.id!,
|
message_seq: msg.id!,
|
||||||
real_id: msg.id!,
|
real_id: msg.id!,
|
||||||
|
real_seq: msg.msgSeq,
|
||||||
message_type: msg.chatType == ChatType.KCHATTYPEGROUP ? 'group' : 'private',
|
message_type: msg.chatType == ChatType.KCHATTYPEGROUP ? 'group' : 'private',
|
||||||
sender: {
|
sender: {
|
||||||
user_id: +(msg.senderUin ?? 0),
|
user_id: +(msg.senderUin ?? 0),
|
||||||
|
@@ -84,17 +84,19 @@ export class OneBotQuickActionApi {
|
|||||||
let notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(false, 100)).find(e => e.seq == flag);
|
let notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(false, 100)).find(e => e.seq == flag);
|
||||||
if (!notify) {
|
if (!notify) {
|
||||||
notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(true, 100)).find(e => e.seq == flag);
|
notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(true, 100)).find(e => e.seq == flag);
|
||||||
|
return { doubt: true, notify };
|
||||||
}
|
}
|
||||||
return notify;
|
return { doubt: false, notify };
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleGroupRequest(request: OB11GroupRequestEvent, quickAction: QuickActionGroupRequest) {
|
async handleGroupRequest(request: OB11GroupRequestEvent, quickAction: QuickActionGroupRequest) {
|
||||||
|
|
||||||
const invite_notify = this.obContext.apis.MsgApi.notifyGroupInvite.get(request.flag);
|
const invite_notify = this.obContext.apis.MsgApi.notifyGroupInvite.get(request.flag);
|
||||||
const notify = invite_notify ?? await this.findNotify(request.flag);
|
const { doubt, notify } = invite_notify ? { doubt: false, notify: invite_notify } : await this.findNotify(request.flag);
|
||||||
|
|
||||||
if (!isNull(quickAction.approve) && notify) {
|
if (!isNull(quickAction.approve) && notify) {
|
||||||
this.core.apis.GroupApi.handleGroupRequest(
|
this.core.apis.GroupApi.handleGroupRequest(
|
||||||
|
doubt,
|
||||||
notify,
|
notify,
|
||||||
quickAction.approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
quickAction.approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
||||||
quickAction.reason,
|
quickAction.reason,
|
||||||
|
@@ -10,6 +10,7 @@ export enum OB11MessageType {
|
|||||||
|
|
||||||
// 消息接口定义
|
// 消息接口定义
|
||||||
export interface OB11Message {
|
export interface OB11Message {
|
||||||
|
real_seq?: string;// 自行扩展
|
||||||
temp_source?: number;
|
temp_source?: number;
|
||||||
message_sent_type?: string;
|
message_sent_type?: string;
|
||||||
target_id?: number; // 自己发送消息/私聊消息
|
target_id?: number; // 自己发送消息/私聊消息
|
||||||
|
@@ -29,7 +29,7 @@ export let webUiPathWrapper: NapCatPathWrapper;
|
|||||||
const MAX_PORT_TRY = 100;
|
const MAX_PORT_TRY = 100;
|
||||||
import * as net from 'node:net';
|
import * as net from 'node:net';
|
||||||
import { WebUiDataRuntime } from './src/helper/Data';
|
import { WebUiDataRuntime } from './src/helper/Data';
|
||||||
|
export let webUiRuntimePort = 6099;
|
||||||
export async function InitPort(parsedConfig: WebUiConfigType): Promise<[string, number, string]> {
|
export async function InitPort(parsedConfig: WebUiConfigType): Promise<[string, number, string]> {
|
||||||
try {
|
try {
|
||||||
await tryUseHost(parsedConfig.host);
|
await tryUseHost(parsedConfig.host);
|
||||||
@@ -45,6 +45,7 @@ export async function InitWebUi(logger: LogWrapper, pathWrapper: NapCatPathWrapp
|
|||||||
webUiPathWrapper = pathWrapper;
|
webUiPathWrapper = pathWrapper;
|
||||||
WebUiConfig = new WebUiConfigWrapper();
|
WebUiConfig = new WebUiConfigWrapper();
|
||||||
const [host, port, token] = await InitPort(await WebUiConfig.GetWebUIConfig());
|
const [host, port, token] = await InitPort(await WebUiConfig.GetWebUIConfig());
|
||||||
|
webUiRuntimePort = port;
|
||||||
if (port == 0) {
|
if (port == 0) {
|
||||||
logger.log('[NapCat] [WebUi] Current WebUi is not run.');
|
logger.log('[NapCat] [WebUi] Current WebUi is not run.');
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user