feat: 隔离context传递 避免高并发干扰一个实例

This commit is contained in:
手瓜一十雪 committed 2025-05-18 19:21:14 +08:00
1 parent e9a048721d
commit 3a1d1f2e59
4 files changed
+21 -12

No files matched your search

+4 -2
View File
@@ -1,16 +1,18 @@
import { ContextMode, SendMsgBase } from './SendMsg';
import { ContextMode, ReturnDataType, SendMsgBase } from './SendMsg';
import { ActionName, BaseCheckResult } from '@/onebot/action/router';
import { OB11PostSendMsg } from '@/onebot/types';
// 未检测参数
class SendPrivateMsg extends SendMsgBase {
override actionName = ActionName.SendPrivateMsg;
override contextMode: ContextMode = ContextMode.Private;
protected override async check(payload: OB11PostSendMsg): Promise<BaseCheckResult> {
payload.message_type = 'private';
return super.check(payload);
}
override async _handle(payload: OB11PostSendMsg): Promise<ReturnDataType> {
return this.base_handle(payload, ContextMode.Private);
}
}
export default SendPrivateMsg;