Compare commits

...

25 Commits

Author SHA1 Message Date
手瓜一十雪
75bb1d2193 Merge pull request #499 from kanocence/main
修复 config 页面样式
2024-11-07 16:14:01 +08:00
手瓜一十雪
2a23820f9b Merge pull request #500 from Stapxs/patch-1
fix: 在处理 file uri 时可能会意外忽略 fragment 段
2024-11-07 16:13:06 +08:00
林小槐
2ee0fed047 fix: 在处理 file uri 时可能会意外忽略 fragment 段
在处理类似 C:\\test\\test#1.txt 时 #1.txt 由于为 url fragment 而被意外截断
2024-11-07 16:10:59 +08:00
kanocence
40be6b9c43 Merge branch 'NapNeko:main' into main 2024-11-07 15:34:19 +08:00
kanocence
a06b3f0246 feat: 💄 修改页面样式 2024-11-07 15:33:57 +08:00
Mlikiowa
4787fa53b4 release: v3.6.3 2024-11-07 04:16:13 +00:00
手瓜一十雪
a06158bf01 fix: 标准化接口 2024-11-07 12:15:49 +08:00
pk5ls20
314e7485b8 chore: format 2024-11-07 10:33:01 +08:00
pk5ls20
aed5d2d9f0 chore: log 2024-11-07 10:31:50 +08:00
pk5ls20
f44e48a28b fix: remove useless import 2024-11-06 16:58:12 +08:00
手瓜一十雪
38be90450c feat: 兼容gocq标准 2024-11-06 16:48:18 +08:00
手瓜一十雪
2dd57d7676 Merge branch 'main' of https://github.com/NapNeko/NapCatQQ 2024-11-06 16:45:04 +08:00
手瓜一十雪
6b3b163fa8 fix: 错误代码 2024-11-06 16:45:01 +08:00
Mlikiowa
9792ebafdc release: v3.6.2 2024-11-06 08:00:05 +00:00
手瓜一十雪
d10e7c37cb fix: link 2024-11-06 15:59:39 +08:00
Mlikiowa
d38f1853a4 release: v3.6.1 2024-11-06 06:42:33 +00:00
手瓜一十雪
bdec16266e fix: #498 2024-11-06 14:42:05 +08:00
Mlikiowa
49ca698ab9 release: v3.6.0 2024-11-06 03:30:17 +00:00
pk5ls20
3efd8163c9 fix: MoeHoo-Linux Amd64 2024-11-06 11:28:57 +08:00
pk5ls20
cc2d11449c release: v3.5.2 2024-11-06 09:28:14 +08:00
pk5ls20
7e9c19ca5b fix: MoeHoo-Linux Arm64 2024-11-06 09:26:15 +08:00
Mlikiowa
3b01b6827f release: v3.5.1 2024-11-05 14:45:36 +00:00
手瓜一十雪
8d9ef851ba fix: linux arm64 2024-11-05 22:45:00 +08:00
手瓜一十雪
b070bc59bc fix: MoeHoo-Linux Amd64 2024-11-05 22:36:47 +08:00
Mlikiowa
8d663946e1 release: v3.5.0 2024-11-05 14:13:33 +00:00
16 changed files with 42 additions and 16 deletions

View File

@@ -4,7 +4,7 @@
"name": "NapCatQQ", "name": "NapCatQQ",
"slug": "NapCat.Framework", "slug": "NapCat.Framework",
"description": "高性能的 OneBot 11 协议实现", "description": "高性能的 OneBot 11 协议实现",
"version": "3.4.11", "version": "3.6.3",
"icon": "./logo.png", "icon": "./logo.png",
"authors": [ "authors": [
{ {

View File

@@ -2,7 +2,7 @@
"name": "napcat", "name": "napcat",
"private": true, "private": true,
"type": "module", "type": "module",
"version": "3.4.11", "version": "3.6.3",
"scripts": { "scripts": {
"build:framework": "vite build --mode framework", "build:framework": "vite build --mode framework",
"build:shell": "vite build --mode shell", "build:shell": "vite build --mode shell",

View File

@@ -215,7 +215,7 @@ export async function checkUriType(Uri: string) {
} }
if (uri.startsWith('file://')) { if (uri.startsWith('file://')) {
let filePath: string; let filePath: string;
const pathname = decodeURIComponent(new URL(uri).pathname); const pathname = decodeURIComponent(new URL(uri).pathname + new URL(uri).hash);
if (process.platform === 'win32') { if (process.platform === 'win32') {
filePath = pathname.slice(1); filePath = pathname.slice(1);
} else { } else {

View File

@@ -1 +1 @@
export const napCatVersion = '3.4.11'; export const napCatVersion = '3.6.3';

View File

@@ -25,6 +25,7 @@ import { OidbSvcTrpcTcp0X929B_0Resp, OidbSvcTrpcTcp0X929D_0Resp } from "@/core/p
import { IndexNode, MsgInfo } from "@/core/packet/proto/oidb/common/Ntv2.RichMediaReq"; import { IndexNode, MsgInfo } from "@/core/packet/proto/oidb/common/Ntv2.RichMediaReq";
import { NTV2RichMediaResp } from "@/core/packet/proto/oidb/common/Ntv2.RichMediaResp"; import { NTV2RichMediaResp } from "@/core/packet/proto/oidb/common/Ntv2.RichMediaResp";
import { RecvPacketData } from "@/core/packet/client/client"; import { RecvPacketData } from "@/core/packet/client/client";
import { napCatVersion } from "@/common/version";
interface OffsetType { interface OffsetType {
@@ -61,11 +62,12 @@ export class NTQQPacketApi {
this.qqVersion = qqversion; this.qqVersion = qqversion;
const table = typedOffset[qqversion + '-' + os.arch()]; const table = typedOffset[qqversion + '-' + os.arch()];
if (!table) { if (!table) {
this.logger.logError('[Core] [Packet] PacketServer Offset table not found for QQVersion: ', qqversion + '-' + os.arch()); this.logger.logError(`[Core] [Packet] PacketBackend 不支持当前QQ版本架构${qqversion}-${os.arch()}
请参照 https://github.com/NapNeko/NapCatQQ/releases/tag/v${napCatVersion} 配置正确的QQ版本`);
return false; return false;
} }
if (this.core.configLoader.configData.packetBackend === 'disable') { if (this.core.configLoader.configData.packetBackend === 'disable') {
this.logger.logWarn('[Core] [Packet] 已禁用Packet后端NapCat.Packet将不会加载'); this.logger.logWarn('[Core] [Packet] 已禁用PacketBackendNapCat.Packet将不会加载');
return false; return false;
} }
this.packetSession = new PacketSession(this.core); this.packetSession = new PacketSession(this.core);

View File

@@ -283,7 +283,7 @@ export class NTQQWebApi {
this.context.logger.logError.bind(this.context.logger)('获取群聊之火失败'); this.context.logger.logError.bind(this.context.logger)('获取群聊之火失败');
} }
} }
if (getType === WebHonorType.PERFORMER || getType === WebHonorType.ALL) { if (getType === WebHonorType.LEGEND || getType === WebHonorType.ALL) {
const RetInternal = await getDataInternal(groupCode, 3); const RetInternal = await getDataInternal(groupCode, 3);
if (RetInternal) { if (RetInternal) {
HonorInfo.legend_list = []; HonorInfo.legend_list = [];

View File

@@ -45,7 +45,7 @@ export class PacketSession {
client = this.judgeClient(core); client = this.judgeClient(core);
break; break;
default: default:
this.logger.logError(`[Core] [Packet] 未知的Packet后端类型 ${prefer},请检查配置文件!`); this.logger.logError(`[Core] [Packet] 未知的PacketBackend ${prefer},请检查配置文件!`);
client = null; client = null;
} }
if (!(client && client.check(core))) { if (!(client && client.check(core))) {

View File

@@ -5,7 +5,7 @@ import { FromSchema, JSONSchema } from 'json-schema-to-ts';
const SchemaData = { const SchemaData = {
type: 'object', type: 'object',
properties: { properties: {
group_id: { type: 'string' }, group_id: { type: ['string', 'number'] },
}, },
required: ['group_id'], required: ['group_id'],
} as const satisfies JSONSchema; } as const satisfies JSONSchema;
@@ -17,6 +17,9 @@ export class SetGroupSign extends BaseAction<Payload, any> {
payloadSchema = SchemaData; payloadSchema = SchemaData;
async _handle(payload: Payload) { async _handle(payload: Payload) {
return await this.core.apis.PacketApi.sendGroupSignPacket(payload.group_id); return await this.core.apis.PacketApi.sendGroupSignPacket(payload.group_id.toString());
} }
} }
export class SendGroupSign extends SetGroupSign {
actionName = ActionName.SendGroupSign;
}

View File

@@ -6,10 +6,15 @@ const SchemaData = {
type: 'object', type: 'object',
properties: { properties: {
friend_id: { type: ['string', 'number'] }, friend_id: { type: ['string', 'number'] },
user_id: { type: ['string', 'number'] },
temp_block: { type: 'boolean' }, temp_block: { type: 'boolean' },
temp_both_del: { type: 'boolean' }, temp_both_del: { type: 'boolean' },
}, },
required: ['friend_id'], oneOf: [
{ required: ['friend_id'] },
{ required: ['user_id'] },
],
} as const satisfies JSONSchema; } as const satisfies JSONSchema;
type Payload = FromSchema<typeof SchemaData>; type Payload = FromSchema<typeof SchemaData>;
@@ -18,7 +23,8 @@ export class GoCQHTTPDeleteFriend extends BaseAction<Payload, any> {
payloadSchema = SchemaData; payloadSchema = SchemaData;
async _handle(payload: Payload) { async _handle(payload: Payload) {
const uid = await this.core.apis.UserApi.getUidByUinV2(payload.friend_id.toString()); const uin = payload.friend_id ?? payload.user_id ?? '';
const uid = await this.core.apis.UserApi.getUidByUinV2(uin.toString());
if (!uid) { if (!uid) {
return { return {

View File

@@ -2,8 +2,6 @@ import { ActionName } from '../types';
import { FromSchema, JSONSchema } from 'json-schema-to-ts'; import { FromSchema, JSONSchema } from 'json-schema-to-ts';
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus"; import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
import { AIVoiceChatType } from "@/core/packet/entities/aiChat"; import { AIVoiceChatType } from "@/core/packet/entities/aiChat";
import { NapProtoEncodeStructType } from "@/core/packet/proto/NapProto";
import { IndexNode } from "@/core/packet/proto/oidb/common/Ntv2.RichMediaReq";
const SchemaData = { const SchemaData = {
type: 'object', type: 'object',

View File

@@ -92,7 +92,7 @@ import { GetGroupFileUrl } from "@/onebot/action/file/GetGroupFileUrl";
import { GetPacketStatus } from "@/onebot/action/packet/GetPacketStatus"; import { GetPacketStatus } from "@/onebot/action/packet/GetPacketStatus";
import { FriendPoke } from "@/onebot/action/user/FriendPoke"; import { FriendPoke } from "@/onebot/action/user/FriendPoke";
import { GetCredentials } from './system/GetCredentials'; import { GetCredentials } from './system/GetCredentials';
import { SetGroupSign } from './extends/SetGroupSign'; import { SendGroupSign, SetGroupSign } from './extends/SetGroupSign';
import { GoCQHTTPGetGroupAtAllRemain } from './go-cqhttp/GetGroupAtAllRemain'; import { GoCQHTTPGetGroupAtAllRemain } from './go-cqhttp/GetGroupAtAllRemain';
import { GoCQHTTPCheckUrlSafely } from './go-cqhttp/GoCQHTTPCheckUrlSafely'; import { GoCQHTTPCheckUrlSafely } from './go-cqhttp/GoCQHTTPCheckUrlSafely';
import { GoCQHTTPGetModelShow } from './go-cqhttp/GoCQHTTPGetModelShow'; import { GoCQHTTPGetModelShow } from './go-cqhttp/GoCQHTTPGetModelShow';
@@ -125,6 +125,7 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo
new TranslateEnWordToZn(obContext, core), new TranslateEnWordToZn(obContext, core),
new GetGroupRootFiles(obContext, core), new GetGroupRootFiles(obContext, core),
new SetGroupSign(obContext, core), new SetGroupSign(obContext, core),
new SendGroupSign(obContext, core),
// onebot11 // onebot11
new SendLike(obContext, core), new SendLike(obContext, core),
new GetMsg(obContext, core), new GetMsg(obContext, core),

View File

@@ -136,6 +136,8 @@ export enum ActionName {
GetGroupIgnoredNotifies = 'get_group_ignored_notifies', GetGroupIgnoredNotifies = 'get_group_ignored_notifies',
SetGroupSign = "set_group_sign", SetGroupSign = "set_group_sign",
SendGroupSign = "send_group_sign",
GetMiniAppArk = "get_mini_app_ark", GetMiniAppArk = "get_mini_app_ark",
// UploadForwardMsg = "upload_forward_msg", // UploadForwardMsg = "upload_forward_msg",
GetAiRecord = "get_ai_record", GetAiRecord = "get_ai_record",

View File

@@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) {
SettingItem( SettingItem(
'<span id="napcat-update-title">Napcat</span>', '<span id="napcat-update-title">Napcat</span>',
void 0, void 0,
SettingButton("V3.4.11", "napcat-update-button", "secondary") SettingButton("V3.6.3", "napcat-update-button", "secondary")
) )
]), ]),
SettingList([ SettingList([

View File

@@ -10,6 +10,20 @@
<link rel="stylesheet" href="./assets/webcomponents.css" /> <link rel="stylesheet" href="./assets/webcomponents.css" />
<link rel="stylesheet" href="./assets/style.css" /> <link rel="stylesheet" href="./assets/style.css" />
<link rel="stylesheet" href="./assets/color.css" /> <link rel="stylesheet" href="./assets/color.css" />
<style>
body > div {
padding: 12px;
@media screen and (min-width: 900px) {
width: 900px;
margin: 0 auto;
}
}
ob-setting-select {
width: 210px;
}
</style>
<!-- 脚手架 --> <!-- 脚手架 -->
<!-- 渲染脚本 --> <!-- 渲染脚本 -->
<script> <script>