fix my idiocy
This commit is contained in:
parent
6b6688fe07
commit
51baffffcc
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ tools/authenticator/access_tokens.txt
|
||||
*.txt
|
||||
access_tokens.json
|
||||
freechatgpt
|
||||
chatgpttoapi
|
||||
|
@ -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)])
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user