mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 16:00:27 +00:00
Compare commits
7 Commits
copilot/fi
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e8b874419 | ||
|
|
af4865e043 | ||
|
|
b6117ed205 | ||
|
|
76bf3719f1 | ||
|
|
f3b9f1916f | ||
|
|
8e8fc471ed | ||
|
|
21de6660db |
@@ -41,6 +41,30 @@ class GetGroupMemberInfo extends OneBotAction<Payload, OB11GroupMember> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _handle (payload: Payload) {
|
async _handle (payload: Payload) {
|
||||||
|
// 处理 @全体成员 的特殊情况,跳过 UID 转换直接返回
|
||||||
|
if (payload.user_id === 'all' || payload.user_id === '0') {
|
||||||
|
return {
|
||||||
|
group_id: +payload.group_id,
|
||||||
|
user_id: payload.user_id === 'all' ? 0 : +payload.user_id,
|
||||||
|
nickname: '全体成员',
|
||||||
|
card: '全体成员',
|
||||||
|
sex: 'unknown' as const,
|
||||||
|
age: 0,
|
||||||
|
area: '',
|
||||||
|
level: '0',
|
||||||
|
qq_level: 0,
|
||||||
|
join_time: 0,
|
||||||
|
last_sent_time: 0,
|
||||||
|
title_expire_time: 0,
|
||||||
|
unfriendly: false,
|
||||||
|
card_changeable: false,
|
||||||
|
is_robot: false,
|
||||||
|
shut_up_timestamp: 0,
|
||||||
|
role: 'member' as const,
|
||||||
|
title: '',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const isNocache = this.parseBoolean(payload.no_cache ?? true);
|
const isNocache = this.parseBoolean(payload.no_cache ?? true);
|
||||||
const uid = await this.getUid(payload.user_id);
|
const uid = await this.getUid(payload.user_id);
|
||||||
const member = await this.getGroupMemberInfo(payload, uid, isNocache);
|
const member = await this.getGroupMemberInfo(payload, uid, isNocache);
|
||||||
|
|||||||
@@ -347,19 +347,21 @@ 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);
|
||||||
|
|
||||||
// Clean up recall event cache if this is a self-device operation
|
|
||||||
if (msg && element?.grayTipElement?.revokeElement.isSelfOperate) {
|
if (msg && element?.grayTipElement?.revokeElement.isSelfOperate) {
|
||||||
const cachedTimeout = this.recallEventCache.get(msg.msgId);
|
const isSelfDevice = this.recallEventCache.has(msg.msgId);
|
||||||
if (cachedTimeout) {
|
if (isSelfDevice) {
|
||||||
clearTimeout(cachedTimeout);
|
await this.core.eventWrapper.registerListen('NodeIKernelMsgListener/onMsgRecall',
|
||||||
this.recallEventCache.delete(msg.msgId);
|
(chatType: ChatType, uid: string, msgSeq: string) => {
|
||||||
|
return chatType === msg?.chatType && uid === msg?.peerUid && msgSeq === msg?.msgSeq;
|
||||||
|
}
|
||||||
|
).catch(() => {
|
||||||
|
msg = undefined;
|
||||||
this.context.logger.logDebug('自操作消息撤回事件');
|
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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user