From 1128cf679cbd171c7e1d5c7d5250f9461c9d9ce0 Mon Sep 17 00:00:00 2001 From: linyuchen Date: Wed, 29 May 2024 16:25:42 +0800 Subject: [PATCH] refactor: send file timeout --- src/onebot11/action/index.ts | 4 ++-- src/onebot11/action/msg/ForwardSingleMsg.ts | 2 +- src/onebot11/action/msg/SendMsg.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/onebot11/action/index.ts b/src/onebot11/action/index.ts index e2e09c3..3785082 100644 --- a/src/onebot11/action/index.ts +++ b/src/onebot11/action/index.ts @@ -46,7 +46,7 @@ import GetFile from './file/GetFile' import { GoCQHTTGetForwardMsgAction } from './go-cqhttp/GetForwardMsg' import { GetCookies } from './user/GetCookie' import { SetMsgEmojiLike } from './msg/SetMsgEmojiLike' -import { ForwardFriendSingleMsg, ForwardSingleGroupMsg } from './msg/ForwardSingleMsg' +import { ForwardFriendSingleMsg, ForwardGroupSingleMsg } from './msg/ForwardSingleMsg' import { GetGroupEssence } from './group/GetGroupEssence' import { GetGroupHonorInfo } from './group/GetGroupHonorInfo' import { GoCQHTTHandleQuickOperation } from './go-cqhttp/QuickOperation' @@ -91,7 +91,7 @@ export const actionHandlers = [ new GetCookies(), new SetMsgEmojiLike(), new ForwardFriendSingleMsg(), - new ForwardSingleGroupMsg(), + new ForwardGroupSingleMsg(), //以下为go-cqhttp api new GetGroupEssence(), new GetGroupHonorInfo(), diff --git a/src/onebot11/action/msg/ForwardSingleMsg.ts b/src/onebot11/action/msg/ForwardSingleMsg.ts index d3d5d6a..0c86def 100644 --- a/src/onebot11/action/msg/ForwardSingleMsg.ts +++ b/src/onebot11/action/msg/ForwardSingleMsg.ts @@ -43,6 +43,6 @@ export class ForwardFriendSingleMsg extends ForwardSingleMsg { actionName = ActionName.ForwardFriendSingleMsg } -export class ForwardSingleGroupMsg extends ForwardSingleMsg { +export class ForwardGroupSingleMsg extends ForwardSingleMsg { actionName = ActionName.ForwardGroupSingleMsg } diff --git a/src/onebot11/action/msg/SendMsg.ts b/src/onebot11/action/msg/SendMsg.ts index 841b07e..42480bf 100644 --- a/src/onebot11/action/msg/SendMsg.ts +++ b/src/onebot11/action/msg/SendMsg.ts @@ -327,7 +327,7 @@ export async function sendMsg( } } log('发送消息总大小', totalSize, 'bytes') - let timeout = ((totalSize / 1024 / 512) * 1000) + 5000 // 512kb/s + let timeout = ((totalSize / 1024 / 100) * 1000) + 5000 // 100/s log('设置消息超时时间', timeout) const returnMsg = await NTQQMsgApi.sendMsg(peer, sendElements, waitComplete, timeout) log('消息发送结果', returnMsg)