hmes98318 / ChatGPT-Discord-Bot

Discord ChatGPT and Image Generator Bot
GNU General Public License v3.0
15 stars 5 forks source link

Status code 429 when sending requests #2

Closed ssocozy closed 1 year ago

ssocozy commented 1 year ago

Status code 429 when sending requests

my token seems fine and did all the needed things. but when I'm sending questions to the bot, status 429 comes

hmes98318 commented 1 year ago

Status code 429 when sending requests

my token seems fine and did all the needed things. but when I'm sending questions to the bot, status 429 comes

Your request message is sending too fast causing API limit. https://discord.com/developers/docs/topics/rate-limits#global-rate-limit

ssocozy commented 1 year ago

Status code 429 when sending requests my token seems fine and did all the needed things. but when I'm sending questions to the bot, status 429 comes

Your request message is sending too fast causing API limit. https://discord.com/developers/docs/topics/rate-limits#global-rate-limit

how exactly do i fix this? i need to change the host ip or change my bot?

ssocozy commented 1 year ago

Status code 429 when sending requests my token seems fine and did all the needed things. but when I'm sending questions to the bot, status 429 comes

Your request message is sending too fast causing API limit. https://discord.com/developers/docs/topics/rate-limits#global-rate-limit

how exactly do i fix this? i need to change the host ip or change my bot?

changing bot and host doesn't fix. it's still status 429

hmes98318 commented 1 year ago

changing bot and host doesn't fix. it's still status 429

Can you attach a detailed error log? What platform is your Bot deployed on? hosting service? Replit? homelab? Execute the following command on the host where the Bot is deployed to check the returned HTTP status code curl -I https://discordapp.com/api/v9/gateway

ssocozy commented 1 year ago

I deployed on replit and tried on vercel.

here's the HTTP status code (checked on replit)

HTTP/2 200 accept-ranges: bytes age: 31129 alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400 cache-control: public, max-age=1800 cf-cache-status: HIT cf-ray: 7a001385adbcf371-ATL content-type: application/json date: Mon, 27 Feb 2023 10:00:55 GMT expires: Mon, 27 Feb 2023 10:30:55 GMT last-modified: Mon, 27 Feb 2023 01:22:06 GMT nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800} report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=4xHpQMLZAAXbkYwDi0T7r%2B%2FhGt4qEAS4AYW%2BmK8u1apWQCHdocN0mOhLqTWnLI8yQj%2F8Mdpi6spT8l2X2atstmpse%2FfHfVtvtjdp5jpe3SouqqkBbkND2VGg7ML8"}],"group":"cf-nel","max_age":604800} server: cloudflare set-cookie: __cfruid=b474c777d4213edc565f17fb4aef8660c33a3df4-1677492055; path=/; domain=.discord.com; HttpOnly; Secure; SameSite=None strict-transport-security: max-age=31536000; includeSubDomains; preload via: 1.1 google x-content-type-options: nosniff x-ratelimit-bucket: f7ead6a7674e5a323d93786263b66cb1 x-ratelimit-limit: 100 x-ratelimit-remaining: 99 x-ratelimit-reset: 1677460926.422 x-ratelimit-reset-after: 0.009 content-length: 35

Heres the attached screenshot: image

hmes98318 commented 1 year ago

I deployed on replit and tried on vercel.

Try to execute kill 1 command in Replit shell. This command completely exits the script, and when you click run again it will run from a different IP Address, bypassing the Discord rate limit.

ssocozy commented 1 year ago

still getting the same error

hmes98318 commented 1 year ago

still getting the same error

umm... Do you get the same error if you try to run the Bot on your own computer?

ssocozy commented 1 year ago

it works now. i just change the openai token with a newer one.