Zero6992 / chatGPT-discord-bot

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

Error while sending message: 429 Too Many Requests #433

Closed Yakonche closed 1 year ago

Yakonche commented 1 year ago

I'm on Windows 11 and i run with "py main.py"

2023-07-04 15:21:30 INFO     src.bot -> yakonche#0 : /chat [test] in (général)
2023-07-04 15:21:31 ERROR    src.aclient -> Error while sending message: 429 Too Many Requests {
    "error": {
        "message": "You exceeded your current quota, please check your plan and billing details.",
        "type": "insufficient_quota",
        "param": null,
        "code": null
    }
}
Traceback (most recent call last):
  File "I:\Téléchargements\chatGPT-discord-bot-1.5.1\src\aclient.py", line 99, in send_message
    response = f"{response}{await responses.official_handle_response(user_message, self)}"
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "I:\Téléchargements\chatGPT-discord-bot-1.5.1\src\responses.py", line 5, in official_handle_response
    return await sync_to_async(client.chatbot.ask)(message)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\asgiref\sync.py", line 448, in __call__
    ret = await asyncio.wait_for(future, timeout=None)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\asyncio\tasks.py", line 442, in wait_for
    return await fut
           ^^^^^^^^^
  File "C:\Python311\Lib\concurrent\futures\thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\asgiref\sync.py", line 490, in thread_handler
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\revChatGPT\V3.py", line 337, in ask
    full_response: str = "".join(response)
                         ^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\revChatGPT\V3.py", line 203, in ask_stream
    raise t.APIConnectionError(
revChatGPT.typings.APIConnectionError: 429 Too Many Requests {
    "error": {
        "message": "You exceeded your current quota, please check your plan and billing details.",
        "type": "insufficient_quota",
        "param": null,
        "code": null
    }
}

Please check if there is a problem with your network connection
Please check that the input is correct, or you can resolve this issue by filing an issue
Project URL: https://github.com/acheong08/ChatGPT

Here is my .env file :

# Discord Bot token https://discord.com/developers/applications
DISCORD_BOT_TOKEN="M****0"

# Unofficial OpenAI ChatGPT authentication (only Plus acoount) # https://chat.openai.com/api/auth/session
UNOFFICIAL_PAID=False
PUID=
ACCESS_TOKEN=

# Official OpenAI API authentication
OPENAI_API_KEY="sk-****xKN"

# Bard session_id
BARD_SESSION_ID=

# ----------------------- #
# Optional setting

# CHAT_MODEL option: OFFICIAL, UNOFFICIAL, Bard, Bing
CHAT_MODEL=OFFICIAL
# GPT_ENGINE option: gpt-3.5-turbo, gpt-4
GPT_ENGINE=gpt-3.5-turbo
LOGGING=True
REPLYING_ALL=False
# Channel using to send the starting-prompt
DISCORD_CHANNEL_ID=
REPLYING_ALL_DISCORD_CHANNEL_ID=

# Enable auto-login for Google Bard and Microsoft Bing to fetch cookies
# Version of your chrome browser
chrome_version=

# Add auto-login for Microsoft Bing, fill in your Microsoft Bing account and password
bing_enable_auto_login=False # True/False
bing_account=
bing_password=

# Add auto-login for Google Bard, fill in your Microsoft Bing account and password
# NOTICE!!! AUTO-LOGIN ONLY WORKS FOR GOOGLE ACCOUNT THAT DOES NOT HAVE 2FA
bard_enable_auto_login=False # True/False
google_account=
google_password=
# ----------------------- #