Zero6992 / chatGPT-discord-bot

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

Auto login and Bard Mode #429

Closed gin063 closed 9 months ago

gin063 commented 1 year ago
  1. Bing required a CAPTCHA verification after about 1 day. 2023-06-24T20:19:59.237311831Z 2023-06-24 20:19:59 ERROR src.responses -> Error occurred: CaptchaChallenge: User needs to solve CAPTCHA to continue. 2023-06-24T20:19:59.715200747Z 2023-06-24 20:19:59 ERROR src.aclient -> Error while sending message: Bing is fail to continue the conversation, this conversation will automatically reset.

  2. Switch to Bard mode failed. 2023-06-24T20:49:07.050787875Z 2023-06-24 20:49:07 ERROR src.bot -> Error while switching to the Bard model: This event loop is already running 2023-06-24T20:49:07.050829783Z Traceback (most recent call last): 2023-06-24T20:49:07.050833098Z File "/DiscordBot/src/bot.py", line 119, in chat_model 2023-06-24T20:49:07.050835677Z client.chatbot = client.get_chatbot_model() 2023-06-24T20:49:07.050837983Z File "/DiscordBot/src/aclient.py", line 73, in get_chatbot_model 2023-06-24T20:49:07.050840427Z return BardChatbot(session_id=self.bard_session_id) 2023-06-24T20:49:07.050842620Z File "/usr/local/lib/python3.10/site-packages/Bard.py", line 63, in init 2023-06-24T20:49:07.050844902Z self.async_chatbot = self.loop.run_until_complete( 2023-06-24T20:49:07.050847066Z File "/usr/local/lib/python3.10/asyncio/base_events.py", line 625, in run_until_complete 2023-06-24T20:49:07.050849369Z self._check_running() 2023-06-24T20:49:07.050851573Z File "/usr/local/lib/python3.10/asyncio/base_events.py", line 584, in _check_running 2023-06-24T20:49:07.050854142Z raise RuntimeError('This event loop is already running') 2023-06-24T20:49:07.050856344Z RuntimeError: This event loop is already running 2023-06-24T20:49:07.052320008Z /DiscordBot/src/bot.py:128: RuntimeWarning: coroutine 'AsyncChatbot.create' was never awaited 2023-06-24T20:49:07.052329923Z logger.exception(f"Error while switching to the {choices.value} model: {e}") 2023-06-24T20:49:07.052333138Z RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Additional question: Is the Chrome Version parameter like this: 114.0.5735.134

gin063 commented 1 year ago

I use Debian 11 to run this bot.

Zero6992 commented 1 year ago

chrome version simply provide an integer, in your case, just 114

Zero6992 commented 1 year ago

first issue you mentioned might not be resolvable for now, bypassing CAPTCHA can be a bit complex

Zero6992 commented 1 year ago

and I'll go check out the second issue

gin063 commented 1 year ago

Thanks for your reply.

gin063 commented 1 year ago

Hello @Zero6992 Sorry to bother you again, can I set a custom role for ChatGPT? It seems like I could add some new personas in "persona.py" and "bot.py" file, does it work if I add new personas by myself? And other parameters, such as max_token, temperature, I don't know where to set these parameters.😂

fractaldna22 commented 11 months ago

you can add personas you just have to list them in both personas.py and in bot.py