Najmul190 / Discord-AI-Selfbot

A Discord chatbot / selfbot that allows users to talk to AI powered by OpenGPT or BARD. The AI runs on a genuine Discord account, not a bot account and has image detection alongside image generation.
GNU General Public License v3.0
78 stars 24 forks source link

[BUG] KeyError: 'choices' #44

Open C0DE4ME opened 3 months ago

C0DE4ME commented 3 months ago

think its just an issue with api/cookies, dunno...? Bard is now Gemini and ChatGPT has had major upgrades, neither seem to work with this now.

ive looked at #41 , #17 , and #36 didnt help much :(

i get:

Task exception was never retrieved future: <Task finished name='Task-22' coro=<on_message..generate_response_in_thread() done, defined at C:\Users\Me\Discord-AI-Selfbot\main.py:253> exception=KeyError('choices')> Traceback (most recent call last): File "C:\Users\Me\Discord-AI-Selfbot\main.py", line 254, in generate_response_in_thread response = await generate_response(prompt, history) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Me\Discord-AI-Selfbot\main.py", line 87, in generate_response choices = response_data["choices"]


KeyError: 'choices'
dhstunn commented 3 months ago

Use bard cookie, chatgpt is broken.

C0DE4ME commented 3 months ago

Use bard cookie, chatgpt is broken.

issue is Bard AI is gone, it is Gemini AI now. followed the same steps to get cookie, but still have issues, any idea?:

https://github.com/Najmul190/Discord-AI-Selfbot?tab=readme-ov-file#step-4-get-your-bard-cookie-value Step 4: Get your BARD cookie value Go to Google's BARD website Click Sign in or Try it Press Ctrl + Shift + I (If you are on Windows) or Cmd + Opt + I (If you are on a Mac). Go to the Application tab Click on Cookies under Storage on the left side Click on https://bard.google.com under Cookies Copy the value of __Secure-1PSID and paste it in the .env file under BARD_COOKIE

ty btw