Skip to content

Commit

Permalink
fix: log
Browse files Browse the repository at this point in the history
  • Loading branch information
deanxv committed Feb 28, 2024
1 parent 9ce1925 commit 500042e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions discord/sendmessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ func SendMsgByAuthorization(c *gin.Context, userAuth, content, channelId string)
if errMessage, ok := result["message"].(string); ok {
if strings.Contains(errMessage, "401: Unauthorized") ||
strings.Contains(errMessage, "You need to verify your account in order to perform this action.") {
common.LogWarn(c.Request.Context(), fmt.Sprintf("USER_AUTHORIZATION:%s 已失效", userAuth))
common.LogWarn(c.Request.Context(), fmt.Sprintf("USER_AUTHORIZATION:%s EXPIRED", userAuth))
return "", &common.DiscordUnauthorizedError{
ErrCode: 401,
Message: "discord 鉴权未通过",
}
}
}
common.LogError(c.Request.Context(), fmt.Sprintf("result:%s", bodyString))
return "", fmt.Errorf("ID is not a string")
common.LogError(c.Request.Context(), fmt.Sprintf("user_auth:%s result:%s", userAuth, bodyString))
return "", fmt.Errorf("/api/v9/channels/%s/messages response err")
} else {
return id, nil
}
Expand Down

0 comments on commit 500042e

Please sign in to comment.