mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
feat: 提高效率
This commit is contained in:
parent
3a03e455c6
commit
a86851b338
@ -200,7 +200,7 @@ export class NTQQMsgApi {
|
|||||||
msgElements,
|
msgElements,
|
||||||
new Map(),
|
new Map(),
|
||||||
],
|
],
|
||||||
() => true,
|
(ret) => ret.result === 0,
|
||||||
msgRecords => {
|
msgRecords => {
|
||||||
for (const msgRecord of msgRecords) {
|
for (const msgRecord of msgRecords) {
|
||||||
if (msgRecord.guildId === msgId && msgRecord.sendStatus === SendStatusType.KSEND_STATUS_SUCCESS) {
|
if (msgRecord.guildId === msgId && msgRecord.sendStatus === SendStatusType.KSEND_STATUS_SUCCESS) {
|
||||||
|
@ -98,11 +98,6 @@ export class SendMsg extends BaseAction<OB11PostSendMsg, ReturnDataType> {
|
|||||||
message: '转发消息不能和普通消息混在一起发送,转发需要保证message只有type为node的元素',
|
message: '转发消息不能和普通消息混在一起发送,转发需要保证message只有type为node的元素',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (payload.user_id && payload.message_type !== 'group') {
|
|
||||||
// const uid = await this.core.apis.UserApi.getUidByUinV2(payload.user_id.toString());
|
|
||||||
// const isBuddy = await NTQQFriendApi.isBuddy(uid!);
|
|
||||||
// if (!isBuddy) { }
|
|
||||||
}
|
|
||||||
return { valid: true };
|
return { valid: true };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -799,16 +799,12 @@ export class OneBotMsgApi {
|
|||||||
this.core.context.logger.logError('发送消息计算预计时间异常', e);
|
this.core.context.logger.logError('发送消息计算预计时间异常', e);
|
||||||
}
|
}
|
||||||
const returnMsg = await this.core.apis.MsgApi.sendMsg(peer, sendElements, waitComplete, timeout);
|
const returnMsg = await this.core.apis.MsgApi.sendMsg(peer, sendElements, waitComplete, timeout);
|
||||||
try {
|
if (!returnMsg) throw new Error('发送消息失败');
|
||||||
returnMsg!.id = MessageUnique.createMsg({
|
returnMsg.id = MessageUnique.createMsg({
|
||||||
chatType: peer.chatType,
|
chatType: peer.chatType,
|
||||||
guildId: '',
|
guildId: '',
|
||||||
peerUid: peer.peerUid,
|
peerUid: peer.peerUid,
|
||||||
}, returnMsg!.msgId);
|
}, returnMsg.msgId);
|
||||||
} catch (e: any) {
|
|
||||||
this.core.context.logger.logDebug('发送消息id获取失败', e);
|
|
||||||
returnMsg!.id = 0;
|
|
||||||
}
|
|
||||||
deleteAfterSentFiles.forEach(file => {
|
deleteAfterSentFiles.forEach(file => {
|
||||||
fsPromise.unlink(file).then().catch(e => this.core.context.logger.logError('发送消息删除文件失败', e));
|
fsPromise.unlink(file).then().catch(e => this.core.context.logger.logError('发送消息删除文件失败', e));
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user