mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
Merge branch 'main' into refactor-config-webui
This commit is contained in:
commit
5ee0afb604
@ -4,7 +4,7 @@
|
|||||||
"name": "NapCatQQ",
|
"name": "NapCatQQ",
|
||||||
"slug": "NapCat.Framework",
|
"slug": "NapCat.Framework",
|
||||||
"description": "高性能的 OneBot 11 协议实现",
|
"description": "高性能的 OneBot 11 协议实现",
|
||||||
"version": "4.0.1",
|
"version": "4.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": "4.0.1",
|
"version": "4.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 = '4.0.1';
|
export const napCatVersion = '4.0.3';
|
||||||
|
@ -472,7 +472,7 @@ export class NTQQFileApi {
|
|||||||
return IMAGE_HTTP_HOST_NT + urlRkey;
|
return IMAGE_HTTP_HOST_NT + urlRkey;
|
||||||
} else if (isNTV2 && rkeyData.online_rkey) {
|
} else if (isNTV2 && rkeyData.online_rkey) {
|
||||||
const rkey = imageAppid === '1406' ? rkeyData.private_rkey : rkeyData.group_rkey;
|
const rkey = imageAppid === '1406' ? rkeyData.private_rkey : rkeyData.group_rkey;
|
||||||
return IMAGE_HTTP_HOST_NT + parsedUrl.pathname + `&rkey=${rkey}`;
|
return IMAGE_HTTP_HOST_NT + `/download?appid=${imageAppid}&fileid=${imageFileId}&rkey=${rkey}`;
|
||||||
} else if (isNTV2 && imageFileId) {
|
} else if (isNTV2 && imageFileId) {
|
||||||
const rkey = imageAppid === '1406' ? rkeyData.private_rkey : rkeyData.group_rkey;
|
const rkey = imageAppid === '1406' ? rkeyData.private_rkey : rkeyData.group_rkey;
|
||||||
return IMAGE_HTTP_HOST + `/download?appid=${imageAppid}&fileid=${imageFileId}&rkey=${rkey}`;
|
return IMAGE_HTTP_HOST + `/download?appid=${imageAppid}&fileid=${imageFileId}&rkey=${rkey}`;
|
||||||
|
@ -8,6 +8,7 @@ const SchemaData = {
|
|||||||
properties: {
|
properties: {
|
||||||
message_id: { type: ['string', 'number'] },
|
message_id: { type: ['string', 'number'] },
|
||||||
emoji_id: { type: ['string', 'number'] },
|
emoji_id: { type: ['string', 'number'] },
|
||||||
|
set: { type: ['boolean', 'string'] }
|
||||||
},
|
},
|
||||||
required: ['message_id', 'emoji_id'],
|
required: ['message_id', 'emoji_id'],
|
||||||
} as const satisfies JSONSchema;
|
} as const satisfies JSONSchema;
|
||||||
@ -26,10 +27,19 @@ export class SetMsgEmojiLike extends BaseAction<Payload, any> {
|
|||||||
if (!payload.emoji_id) {
|
if (!payload.emoji_id) {
|
||||||
throw new Error('emojiId not found');
|
throw new Error('emojiId not found');
|
||||||
}
|
}
|
||||||
|
if (!payload.set) {
|
||||||
|
payload.set = true;
|
||||||
|
}
|
||||||
|
|
||||||
const msgData = (await this.core.apis.MsgApi.getMsgsByMsgId(msg.Peer, [msg.MsgId])).msgList;
|
const msgData = (await this.core.apis.MsgApi.getMsgsByMsgId(msg.Peer, [msg.MsgId])).msgList;
|
||||||
if (!msgData || msgData.length == 0 || !msgData[0].msgSeq) {
|
if (!msgData || msgData.length == 0 || !msgData[0].msgSeq) {
|
||||||
throw new Error('find msg by msgid error');
|
throw new Error('find msg by msgid error');
|
||||||
}
|
}
|
||||||
return await this.core.apis.MsgApi.setEmojiLike(msg.Peer, msgData[0].msgSeq, payload.emoji_id.toString(), true);
|
return await this.core.apis.MsgApi.setEmojiLike(
|
||||||
|
msg.Peer,
|
||||||
|
msgData[0].msgSeq,
|
||||||
|
payload.emoji_id.toString(),
|
||||||
|
typeof payload.set == 'string' ? payload.set === 'true' : !!payload
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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("V4.0.1", "napcat-update-button", "secondary")
|
SettingButton("V4.0.3", "napcat-update-button", "secondary")
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
SettingList([
|
SettingList([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user