diff --git a/service/channel.go b/service/channel.go index 4d38e6edc..0f6909503 100644 --- a/service/channel.go +++ b/service/channel.go @@ -18,6 +18,14 @@ func formatNotifyType(channelId int, status int) string { // disable & notify func DisableChannel(channelError types.ChannelError, reason string) { + // 检查是否启用自动禁用功能 + if !channelError.AutoBan { + if common.DebugEnabled { + common.SysLog(fmt.Sprintf("通道「%s」(#%d)未启用自动禁用功能,跳过禁用操作", channelError.ChannelName, channelError.ChannelId)) + } + return + } + success := model.UpdateChannelStatus(channelError.ChannelId, channelError.UsingKey, common.ChannelStatusAutoDisabled, reason) if success { subject := fmt.Sprintf("通道「%s」(#%d)已被禁用", channelError.ChannelName, channelError.ChannelId)