mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
Merge branch 'main' into laana
This commit is contained in:
commit
79115d67ff
@ -4,7 +4,7 @@
|
|||||||
"name": "NapCatQQ",
|
"name": "NapCatQQ",
|
||||||
"slug": "NapCat.Framework",
|
"slug": "NapCat.Framework",
|
||||||
"description": "高性能的 OneBot 11 协议实现",
|
"description": "高性能的 OneBot 11 协议实现",
|
||||||
"version": "2.3.6",
|
"version": "2.3.7",
|
||||||
"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": "2.3.6",
|
"version": "2.3.7",
|
||||||
"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 = '2.3.6';
|
export const napCatVersion = '2.3.7';
|
||||||
|
@ -292,7 +292,7 @@ export class NTQQGroupApi {
|
|||||||
const listener = this.core.eventWrapper.registerListen(
|
const listener = this.core.eventWrapper.registerListen(
|
||||||
'NodeIKernelGroupListener/onMemberListChange',
|
'NodeIKernelGroupListener/onMemberListChange',
|
||||||
1,
|
1,
|
||||||
500,
|
5000,
|
||||||
(params) => params.sceneId === sceneId,
|
(params) => params.sceneId === sceneId,
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
|
@ -113,7 +113,7 @@ export class NTQQMsgApi {
|
|||||||
return await this.context.session.getMsgService().getMsgsBySeqList(peer, msgSeqList);
|
return await this.context.session.getMsgService().getMsgsBySeqList(peer, msgSeqList);
|
||||||
}
|
}
|
||||||
async getMsgBySeqExFirstMsg(peer: Peer, rootMsgId: string, replyMsgId: string) {
|
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);
|
console.log(reply);
|
||||||
}
|
}
|
||||||
async getMsgExBySeq(peer: Peer, msgSeq: string) {
|
async getMsgExBySeq(peer: Peer, msgSeq: string) {
|
||||||
@ -157,11 +157,16 @@ export class NTQQMsgApi {
|
|||||||
return this.context.session.getMsgService().getMsgsIncludeSelf(peer, msgId, count, isReverseOrder);
|
return this.context.session.getMsgService().getMsgsIncludeSelf(peer, msgId, count, isReverseOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
async recallMsg(peer: Peer, msgIds: string[]) {
|
async recallMsg(peer: Peer, msgId: string) {
|
||||||
await this.context.session.getMsgService().recallMsg({
|
await this.core.eventWrapper.callNormalEventV2(
|
||||||
chatType: peer.chatType,
|
'NodeIKernelMsgService/recallMsg',
|
||||||
peerUid: peer.peerUid,
|
'NodeIKernelMsgListener/onMsgInfoListUpdate',
|
||||||
}, msgIds);
|
[peer, [msgId]],
|
||||||
|
() => true,
|
||||||
|
(updatedList) => updatedList.find(m => m.msgId === msgId && m.recallTime !== '0') !== undefined,
|
||||||
|
1,
|
||||||
|
1000,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async PrepareTempChat(toUserUid: string, GroupCode: string, nickname: string) {
|
async PrepareTempChat(toUserUid: string, GroupCode: string, nickname: string) {
|
||||||
|
@ -25,15 +25,7 @@ class DeleteMsg extends BaseAction<Payload, void> {
|
|||||||
async _handle(payload: Payload) {
|
async _handle(payload: Payload) {
|
||||||
const msg = MessageUnique.getMsgIdAndPeerByShortId(Number(payload.message_id));
|
const msg = MessageUnique.getMsgIdAndPeerByShortId(Number(payload.message_id));
|
||||||
if (msg) {
|
if (msg) {
|
||||||
const ret = this.core.eventWrapper.registerListen(
|
await this.core.apis.MsgApi.recallMsg(msg.Peer, msg.MsgId);
|
||||||
'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');
|
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Recall failed');
|
throw new Error('Recall failed');
|
||||||
}
|
}
|
||||||
|
@ -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('V2.3.6', 'napcat-update-button', 'secondary'),
|
SettingButton('V2.3.7', '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("V2.3.6", "napcat-update-button", "secondary")
|
SettingButton("V2.3.7", "napcat-update-button", "secondary")
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
SettingList([
|
SettingList([
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="text"] {
|
input[type="password"] {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
@ -64,7 +64,7 @@
|
|||||||
<form id="token-form" onsubmit="event.preventDefault(); submitToken();">
|
<form id="token-form" onsubmit="event.preventDefault(); submitToken();">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<label for="token-input">Enter Token:</label>
|
<label for="token-input">Enter Token:</label>
|
||||||
<input type="text" id="token-input" required>
|
<input type="password" id="token-input" required>
|
||||||
</div>
|
</div>
|
||||||
<p class="error-message hidden" id="error-message"></p>
|
<p class="error-message hidden" id="error-message"></p>
|
||||||
<button type="submit">Login</button>
|
<button type="submit">Login</button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user