From b33922f1f7b6bbe256ee15cae4fc76fc48b7c6bb Mon Sep 17 00:00:00 2001 From: RANKTW <37373560+RANKTW@users.noreply.github.com> Date: Mon, 25 Jul 2022 07:24:31 +0000 Subject: [PATCH] Fix incorrect Cloudflare Error 1015 detect If Discord return a payload containing "1015" it will incorrectly assume IP is being rate limited for example: ```{... "approximate_member_count": 1015}``` --- instance/extra.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instance/extra.go b/instance/extra.go index c9a4f09..d6dc626 100644 --- a/instance/extra.go +++ b/instance/extra.go @@ -262,7 +262,7 @@ func (in *Instance) Invite(Code string) error { j++ continue } - if strings.Contains(string(body), "1015") { + if resp.StatusCode == 429 && strings.Contains(string(body), "1015") { utilities.LogErr("Cloudflare Error 1015 - Your IP is being Rate Limited. Use proxies. If you already are, make sure proxy_from_file is enabled in your config") break }