fix: channel auto ban

This commit is contained in:
CalciumIon
2024-07-04 22:46:33 +08:00
parent 584eefec3e
commit d4578e28b3
6 changed files with 20 additions and 12 deletions

View File

@@ -228,7 +228,7 @@ func testAllChannels(notify bool) error {
Error: *openaiErr,
LocalError: false,
}
if isChannelEnabled && service.ShouldDisableChannel(&openAiErrWithStatus) && ban {
if isChannelEnabled && service.ShouldDisableChannel(channel.Type, &openAiErrWithStatus) && ban {
service.DisableChannel(channel.Id, channel.Name, err.Error())
}
if !isChannelEnabled && service.ShouldEnableChannel(err, openaiErr, channel.Status) {