mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-11 23:40:24 +00:00
style: 标准化样式
This commit is contained in:
@@ -30,7 +30,7 @@ class GetMsg extends BaseAction<Payload, OB11Message> {
|
||||
const MsgShortId = MessageUnique.getShortIdByMsgId(payload.message_id.toString());
|
||||
const msgIdWithPeer = MessageUnique.getMsgIdAndPeerByShortId(MsgShortId || parseInt(payload.message_id.toString()));
|
||||
if (!msgIdWithPeer) {
|
||||
throw ('消息不存在');
|
||||
throw new Error('消息不存在');
|
||||
}
|
||||
const peer = { guildId: '', peerUid: msgIdWithPeer?.Peer.peerUid, chatType: msgIdWithPeer.Peer.chatType };
|
||||
const msg = await NTQQMsgApi.getMsgsByMsgId(
|
||||
|
||||
@@ -36,7 +36,7 @@ class MarkMsgAsRead extends BaseAction<PlayloadType, null> {
|
||||
// 调用API
|
||||
const ret = await NTQQMsgApi.setMsgRead(await this.getPeer(payload));
|
||||
if (ret.result != 0) {
|
||||
throw ('设置已读失败,' + ret.errMsg);
|
||||
throw new Error('设置已读失败,' + ret.errMsg);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export async function sendMsg(coreContext: NapCatCore, peer: Peer, sendElements:
|
||||
const NTQQMsgApi = coreContext.apis.MsgApi;
|
||||
const logger = coreContext.context.logger;
|
||||
if (!sendElements.length) {
|
||||
throw ('消息体无法解析, 请检查是否发送了不支持的消息类型');
|
||||
throw new Error ('消息体无法解析, 请检查是否发送了不支持的消息类型');
|
||||
}
|
||||
let totalSize = 0;
|
||||
let timeout = 10000;
|
||||
|
||||
Reference in New Issue
Block a user