mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-07 14:53:40 +08:00
feat: automatically ban channels that exceeded quota
This commit is contained in:
@@ -57,6 +57,8 @@ func ShouldDisableChannel(err *relaymodel.OpenAIError, statusCode int) bool {
|
|||||||
return true
|
return true
|
||||||
} else if strings.HasPrefix(err.Message, "This organization has been disabled.") {
|
} else if strings.HasPrefix(err.Message, "This organization has been disabled.") {
|
||||||
return true
|
return true
|
||||||
|
} else if strings.HasPrefix(err.Message, "You exceeded your current quota") {
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user