This repository was archived by the owner on May 18, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 427
Bot won't respond to DM #231
Comments
Hi there, I understand you're facing an issue with the bot not being able to DM back and only reacting to messages. The error message you posted indicates that the OpenAI API key is not being recognized. Here are some advanced debugging steps and code modifications you can try: Debugging Steps:
Code Modifications:
By following these advanced debugging steps and implementing the code modifications, you should be able to resolve the issue you're facing. If the problem persists, please provide more details for further investigation. Best, |
Chatgpt wrote that lol |
Stale |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have chacked every setting I can find to try get the bot to DM back, will only react to messages. I have both my discord token and chimera gpt key inputted in as required. This is what error message I am getting back.
Traceback (most recent call last):
File "/home/runner/Discord-AI-Chatbot/.pythonlibs/lib/python3.10/site-packages/discord/client.py", line 441, in _run_event
await coro(*args, **kwargs)
File "/home/runner/Discord-AI-Chatbot/main.py", line 173, in on_message
response = await asyncio.to_thread(generate_response, instructions=instructions, search=search_results, history=history)
File "/nix/store/xf54733x4chbawkh1qvy9i1i4mlscy1c-python3-3.10.11/lib/python3.10/asyncio/threads.py", line 25, in to_thread
return await loop.run_in_executor(None, func_call)
File "/nix/store/xf54733x4chbawkh1qvy9i1i4mlscy1c-python3-3.10.11/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/runner/Discord-AI-Chatbot/bot_utilities/ai_utils.py", line 92, in generate_response
response = openai.ChatCompletion.create(
File "/home/runner/Discord-AI-Chatbot/.pythonlibs/lib/python3.10/site-packages/openai/api_resources/chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "/home/runner/Discord-AI-Chatbot/.pythonlibs/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 151, in create
) = cls.__prepare_create_request(
File "/home/runner/Discord-AI-Chatbot/.pythonlibs/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 108, in __prepare_create_request
requestor = api_requestor.APIRequestor(
File "/home/runner/Discord-AI-Chatbot/.pythonlibs/lib/python3.10/site-packages/openai/api_requestor.py", line 139, in init
self.api_key = key or util.default_api_key()
File "/home/runner/Discord-AI-Chatbot/.pythonlibs/lib/python3.10/site-packages/openai/util.py", line 186, in default_api_key
raise openai.error.AuthenticationError(
openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = ', or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = '. You can generate API keys in the OpenAI web interface. See https://platform.openai.com/account/api-keys for details.
The text was updated successfully, but these errors were encountered: