mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix: #1051
This commit is contained in:
@@ -58,6 +58,7 @@ export interface GrayTipRovokeElement {
|
|||||||
operatorUid: string;
|
operatorUid: string;
|
||||||
operatorNick: string;
|
operatorNick: string;
|
||||||
operatorRemark: string;
|
operatorRemark: string;
|
||||||
|
isSelfOperate: boolean; // 是否是自己撤回的
|
||||||
operatorMemRemark?: string;
|
operatorMemRemark?: string;
|
||||||
wording: string; // 自定义的撤回提示语
|
wording: string; // 自定义的撤回提示语
|
||||||
}
|
}
|
||||||
|
@@ -270,7 +270,6 @@ export class NapCatOneBot11Adapter {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
msgListener.onAddSendMsg = async (msg) => {
|
msgListener.onAddSendMsg = async (msg) => {
|
||||||
try {
|
try {
|
||||||
if (msg.sendStatus == SendStatusType.KSEND_STATUS_SENDING) {
|
if (msg.sendStatus == SendStatusType.KSEND_STATUS_SENDING) {
|
||||||
@@ -305,8 +304,18 @@ export class NapCatOneBot11Adapter {
|
|||||||
peerUid: uid,
|
peerUid: uid,
|
||||||
guildId: ''
|
guildId: ''
|
||||||
};
|
};
|
||||||
const msg = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeq(peer, msgSeq)).msgList.find(e => e.msgType == NTMsgType.KMSGTYPEGRAYTIPS);
|
let msg = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeq(peer, msgSeq)).msgList.find(e => e.msgType == NTMsgType.KMSGTYPEGRAYTIPS);
|
||||||
const element = msg?.elements.find(e => !!e.grayTipElement?.revokeElement);
|
const element = msg?.elements.find(e => !!e.grayTipElement?.revokeElement);
|
||||||
|
if (element?.grayTipElement?.revokeElement.isSelfOperate && msg) {
|
||||||
|
await this.core.eventWrapper.registerListen('NodeIKernelMsgListener/onMsgRecall',
|
||||||
|
(chatType: ChatType, uid: string, msgSeq: string) => {
|
||||||
|
return chatType === msg?.chatType && uid === msg?.peerUid && msgSeq === msg?.msgSeq;
|
||||||
|
}
|
||||||
|
).catch(() => {
|
||||||
|
msg = undefined;
|
||||||
|
this.context.logger.logDebug('自操作消息撤回事件');
|
||||||
|
});
|
||||||
|
}
|
||||||
if (msg && element) {
|
if (msg && element) {
|
||||||
const recallEvent = await this.emitRecallMsg(msg, element);
|
const recallEvent = await this.emitRecallMsg(msg, element);
|
||||||
try {
|
try {
|
||||||
@@ -317,6 +326,7 @@ export class NapCatOneBot11Adapter {
|
|||||||
this.context.logger.logError('处理消息撤回失败', e);
|
this.context.logger.logError('处理消息撤回失败', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
msgListener.onKickedOffLine = async (kick) => {
|
msgListener.onKickedOffLine = async (kick) => {
|
||||||
const event = new BotOfflineEvent(this.core, kick.tipsTitle, kick.tipsDesc);
|
const event = new BotOfflineEvent(this.core, kick.tipsTitle, kick.tipsDesc);
|
||||||
|
Reference in New Issue
Block a user