From abc53cb208aac5546be811d6953c8ff6cad3035c Mon Sep 17 00:00:00 2001 From: JustSong Date: Sat, 15 Jul 2023 11:49:58 +0800 Subject: [PATCH] feat: disable channel when account_deactivated received (close #271) --- controller/relay.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/relay.go b/controller/relay.go index 42aa0c0f9d..c8bd929c0a 100644 --- a/controller/relay.go +++ b/controller/relay.go @@ -124,7 +124,7 @@ func Relay(c *gin.Context) { channelId := c.GetInt("channel_id") common.SysError(fmt.Sprintf("relay error (channel #%d): %s", channelId, err.Message)) // https://platform.openai.com/docs/guides/error-codes/api-errors - if common.AutomaticDisableChannelEnabled && (err.Type == "insufficient_quota" || err.Code == "invalid_api_key") { + if common.AutomaticDisableChannelEnabled && (err.Type == "insufficient_quota" || err.Code == "invalid_api_key" || err.Code == "account_deactivated") { channelId := c.GetInt("channel_id") channelName := c.GetString("channel_name") disableChannel(channelId, channelName, err.Message)