refactor: send file timeout

This commit is contained in:
linyuchen 2024-05-29 16:25:42 +08:00
parent f336317a33
commit 1128cf679c
3 changed files with 4 additions and 4 deletions

View File

@ -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(),

View File

@ -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
}

View File

@ -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)