Merge branch 'main' into laana

This commit is contained in:
Wesley F. Young 2024-09-07 23:30:24 +08:00
commit 79115d67ff
9 changed files with 21 additions and 24 deletions

View File

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

View File

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

View File

@ -1 +1 @@
export const napCatVersion = '2.3.6';
export const napCatVersion = '2.3.7';

View File

@ -292,7 +292,7 @@ export class NTQQGroupApi {
const listener = this.core.eventWrapper.registerListen(
'NodeIKernelGroupListener/onMemberListChange',
1,
500,
5000,
(params) => params.sceneId === sceneId,
);
try {

View File

@ -113,7 +113,7 @@ export class NTQQMsgApi {
return await this.context.session.getMsgService().getMsgsBySeqList(peer, msgSeqList);
}
async getMsgBySeqExFirstMsg(peer: Peer, rootMsgId: string, replyMsgId: string) {
let reply = await this.context.session.getMsgService().getSourceOfReplyMsgV2(peer, rootMsgId, replyMsgId);
const reply = await this.context.session.getMsgService().getSourceOfReplyMsgV2(peer, rootMsgId, replyMsgId);
console.log(reply);
}
async getMsgExBySeq(peer: Peer, msgSeq: string) {
@ -157,11 +157,16 @@ export class NTQQMsgApi {
return this.context.session.getMsgService().getMsgsIncludeSelf(peer, msgId, count, isReverseOrder);
}
async recallMsg(peer: Peer, msgIds: string[]) {
await this.context.session.getMsgService().recallMsg({
chatType: peer.chatType,
peerUid: peer.peerUid,
}, msgIds);
async recallMsg(peer: Peer, msgId: string) {
await this.core.eventWrapper.callNormalEventV2(
'NodeIKernelMsgService/recallMsg',
'NodeIKernelMsgListener/onMsgInfoListUpdate',
[peer, [msgId]],
() => true,
(updatedList) => updatedList.find(m => m.msgId === msgId && m.recallTime !== '0') !== undefined,
1,
1000,
);
}
async PrepareTempChat(toUserUid: string, GroupCode: string, nickname: string) {

View File

@ -25,15 +25,7 @@ class DeleteMsg extends BaseAction<Payload, void> {
async _handle(payload: Payload) {
const msg = MessageUnique.getMsgIdAndPeerByShortId(Number(payload.message_id));
if (msg) {
const ret = this.core.eventWrapper.registerListen(
'NodeIKernelMsgListener/onMsgInfoListUpdate',
1,
1000,
(msgs) => !!msgs.find(m => m.msgId === msg.MsgId && m.recallTime !== '0'),
).catch(() => undefined);
await this.core.apis.MsgApi.recallMsg(msg.Peer, [msg.MsgId]);
const data = await ret;
if (!data) throw new Error('Recall failed');
await this.core.apis.MsgApi.recallMsg(msg.Peer, msg.MsgId);
} else {
throw new Error('Recall failed');
}

View File

@ -30,7 +30,7 @@ async function onSettingWindowCreated(view: Element) {
SettingItem(
'<span id="napcat-update-title">Napcat</span>',
undefined,
SettingButton('V2.3.6', 'napcat-update-button', 'secondary'),
SettingButton('V2.3.7', 'napcat-update-button', 'secondary'),
),
]),
SettingList([

View File

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

View File

@ -29,7 +29,7 @@
margin-bottom: 20px;
}
input[type="text"] {
input[type="password"] {
width: 90%;
padding: 10px;
font-size: 16px;
@ -64,7 +64,7 @@
<form id="token-form" onsubmit="event.preventDefault(); submitToken();">
<div class="input-group">
<label for="token-input">Enter Token:</label>
<input type="text" id="token-input" required>
<input type="password" id="token-input" required>
</div>
<p class="error-message hidden" id="error-message"></p>
<button type="submit">Login</button>
@ -133,4 +133,4 @@
</script>
</body>
</html>
</html>