Zero6992 / chatGPT-discord-bot

Integrate ChatGPT into your own discord bot
GNU General Public License v2.0
2.63k stars 701 forks source link

Blocked API RateLimit #368

Closed Hide-in-base closed 1 year ago

Hide-in-base commented 1 year ago

Can you help me fix this please

Traceback (most recent call last):
  File "/home/container/main.py", line 30, in <module>
    bot.run_discord_bot()
  File "/home/container/src/bot.py", line 289, in run_discord_bot
    client.run(TOKEN)
  File "/home/container/.local/lib/python3.10/site-packages/discord/client.py", line 860, in run
    asyncio.run(runner())
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/container/.local/lib/python3.10/site-packages/discord/client.py", line 849, in runner
    await self.start(token, reconnect=reconnect)
  File "/home/container/.local/lib/python3.10/site-packages/discord/client.py", line 777, in start
    await self.login(token)
  File "/home/container/.local/lib/python3.10/site-packages/discord/client.py", line 612, in login
    data = await self.http.static_login(token)
  File "/home/container/.local/lib/python3.10/site-packages/discord/http.py", line 801, in static_login
    data = await self.request(Route('GET', '/users/@me'))
  File "/home/container/.local/lib/python3.10/site-packages/discord/http.py", line 680, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 429 Too Many Requests (error code: 0): You are being blocked from accessing our API temporarily due to exceeding our rate limits frequently. Please read our docs at https://discord.com/developers/docs/topics/rate-limits to prevent this moving forward.
Hide-in-base commented 1 year ago

Just tell me what should I put in my code to make ratelimit please:)

Zero6992 commented 1 year ago

Please provide your environment

r1chard-lyu commented 1 year ago

This is 429 Too Many Requests due to exceeding our rate limits frequently. I also encountered this problem. It seems to be an API issue provided by Open AI. After I changed to a brand new API, this problem was solved.