1
0

fix my idiocy

This commit is contained in:
Antonio 2023-05-15 19:29:09 +08:00
parent 6b6688fe07
commit 51baffffcc
3 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ tools/authenticator/access_tokens.txt
*.txt
access_tokens.json
freechatgpt
chatgpttoapi

View File

@ -59,11 +59,11 @@ func random_int(min int, max int) int {
}
func SendRequest(message typings.ChatGPTRequest, access_token string) (*http.Response, error) {
if http_proxy != "" && len(proxies) > 0 {
if http_proxy != "" && len(proxies) == 0 {
client.SetProxy(http_proxy)
}
// Take random proxy from proxies.txt
if len(proxies) > 0 {
if len(proxies) > 1 {
client.SetProxy(proxies[random_int(0, len(proxies)-1)])
}

View File

@ -54,7 +54,7 @@ func check_access(token string) bool {
json.NewDecoder(resp.Body).Decode(&result)
// Check if "tool1", "tool2", or "tool3" is in the features array
for _, feature := range result["features"].([]interface{}) {
if feature == "tool1" || feature == "tool2" || feature == "tool3" {
if feature == "tools1" || feature == "tools2" || feature == "tools3" {
return true
}
}