mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b6a8094554 | ||
![]() |
4083b35436 | ||
![]() |
bb72d70baf | ||
![]() |
95d1a77f52 | ||
![]() |
051729886e | ||
![]() |
0f00123dc7 |
@@ -23,4 +23,4 @@
|
|||||||
"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": "3.0.1",
|
"version": "3.0.3",
|
||||||
"icon": "./logo.png",
|
"icon": "./logo.png",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
"name": "napcat",
|
"name": "napcat",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "3.0.1",
|
"version": "3.0.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",
|
||||||
|
@@ -1 +1 @@
|
|||||||
export const napCatVersion = '3.0.1';
|
export const napCatVersion = '3.0.3';
|
||||||
|
@@ -11,7 +11,7 @@ export class NTQQFriendApi {
|
|||||||
this.core = core;
|
this.core = core;
|
||||||
}
|
}
|
||||||
async setBuddyRemark(uid: string, remark: string) {
|
async setBuddyRemark(uid: string, remark: string) {
|
||||||
return this.context.session.getBuddyService().setBuddyRemark(uid, remark);
|
return this.context.session.getBuddyService().setBuddyRemark({ uid, remark });
|
||||||
}
|
}
|
||||||
async getBuddyV2SimpleInfoMap(refresh = false) {
|
async getBuddyV2SimpleInfoMap(refresh = false) {
|
||||||
const buddyService = this.context.session.getBuddyService();
|
const buddyService = this.context.session.getBuddyService();
|
||||||
|
@@ -517,6 +517,12 @@ export enum AtType {
|
|||||||
atAll = 1,
|
atAll = 1,
|
||||||
atUser = 2
|
atUser = 2
|
||||||
}
|
}
|
||||||
|
export enum MsgSourceType {
|
||||||
|
K_DOWN_SOURCETYPE_AIOINNER = 1,
|
||||||
|
K_DOWN_SOURCETYPE_BIGSCREEN = 2,
|
||||||
|
K_DOWN_SOURCETYPE_HISTORY = 3,
|
||||||
|
K_DOWN_SOURCETYPE_UNKNOWN = 0
|
||||||
|
}
|
||||||
|
|
||||||
// 来自Android分析
|
// 来自Android分析
|
||||||
export enum ChatType {
|
export enum ChatType {
|
||||||
@@ -874,6 +880,8 @@ export interface RawMessage {
|
|||||||
/**
|
/**
|
||||||
* 扩展字段,与 Ob11 msg ID 有关
|
* 扩展字段,与 Ob11 msg ID 有关
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
id?: number;
|
id?: number;
|
||||||
|
|
||||||
guildId: string;
|
guildId: string;
|
||||||
@@ -950,6 +958,8 @@ export interface RawMessage {
|
|||||||
records: RawMessage[];
|
records: RawMessage[];
|
||||||
|
|
||||||
elements: MessageElement[];
|
elements: MessageElement[];
|
||||||
|
|
||||||
|
sourceType: MsgSourceType;
|
||||||
}
|
}
|
||||||
export interface QueryMsgsParams {
|
export interface QueryMsgsParams {
|
||||||
chatInfo: Peer;
|
chatInfo: Peer;
|
||||||
|
@@ -36,7 +36,7 @@ export interface NodeIKernelBuddyService {
|
|||||||
|
|
||||||
getBuddyRemark(uid: number): string;
|
getBuddyRemark(uid: number): string;
|
||||||
|
|
||||||
setBuddyRemark(uid: string, remark: string): void;
|
setBuddyRemark(param: { uid: string, remark: string, signInfo?: unknown }): void;
|
||||||
|
|
||||||
getAvatarUrl(uid: number): string;
|
getAvatarUrl(uid: number): string;
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@ import {
|
|||||||
GroupNotifyMsgStatus,
|
GroupNotifyMsgStatus,
|
||||||
GroupNotifyMsgType,
|
GroupNotifyMsgType,
|
||||||
InstanceContext,
|
InstanceContext,
|
||||||
|
MsgSourceType,
|
||||||
NapCatCore,
|
NapCatCore,
|
||||||
NodeIKernelBuddyListener,
|
NodeIKernelBuddyListener,
|
||||||
NodeIKernelGroupListener,
|
NodeIKernelGroupListener,
|
||||||
@@ -303,8 +304,10 @@ export class NapCatOneBot11Adapter {
|
|||||||
},
|
},
|
||||||
m.msgId,
|
m.msgId,
|
||||||
);
|
);
|
||||||
await this.emitMsg(m)
|
if (m.sourceType == MsgSourceType.K_DOWN_SOURCETYPE_AIOINNER) {
|
||||||
.catch(e => this.context.logger.logError.bind(this.context.logger)('处理消息失败', e));
|
await this.emitMsg(m)
|
||||||
|
.catch(e => this.context.logger.logError.bind(this.context.logger)('处理消息失败', e));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -573,6 +576,8 @@ export class NapCatOneBot11Adapter {
|
|||||||
this.networkManager.emitEvent(ob11Msg);
|
this.networkManager.emitEvent(ob11Msg);
|
||||||
}).catch(e => this.context.logger.logError.bind(this.context.logger)('constructMessage error: ', e));
|
}).catch(e => this.context.logger.logError.bind(this.context.logger)('constructMessage error: ', e));
|
||||||
|
|
||||||
|
console.log('message', message);
|
||||||
|
|
||||||
this.apis.GroupApi.parseGroupEvent(message).then(groupEvent => {
|
this.apis.GroupApi.parseGroupEvent(message).then(groupEvent => {
|
||||||
if (groupEvent) {
|
if (groupEvent) {
|
||||||
// log("post group event", groupEvent);
|
// log("post group event", groupEvent);
|
||||||
|
@@ -30,7 +30,7 @@ async function onSettingWindowCreated(view: Element) {
|
|||||||
SettingItem(
|
SettingItem(
|
||||||
'<span id="napcat-update-title">Napcat</span>',
|
'<span id="napcat-update-title">Napcat</span>',
|
||||||
undefined,
|
undefined,
|
||||||
SettingButton('V3.0.1', 'napcat-update-button', 'secondary'),
|
SettingButton('V3.0.3', 'napcat-update-button', 'secondary'),
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
SettingList([
|
SettingList([
|
||||||
|
@@ -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.0.1", "napcat-update-button", "secondary")
|
SettingButton("V3.0.3", "napcat-update-button", "secondary")
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
SettingList([
|
SettingList([
|
||||||
|
Reference in New Issue
Block a user