n3d1117 / chatgpt-telegram-bot

🤖 A Telegram bot that integrates with OpenAI's official ChatGPT APIs to provide answers, written in Python
GNU General Public License v2.0
2.99k stars 1.38k forks source link

Error: 'Chatbot' object has no attribute 'headers' #3

Closed EbadiDev closed 1 year ago

EbadiDev commented 1 year ago

I did everything you said but i don't get anything back running on Ubuntu 22.04 here logs:

(chatgpt-telegram-bot) root@linux:~/chatgpt-telegram-bot# python main.py
Logging in...
Error logging in (Probably wrong credentials)
Error refreshing session:
Error logging in
2022-12-07 14:36:54,351 - telegram.ext._application - INFO - Application started
2022-12-07 14:36:54,632 - root - INFO - New message received from user @ArchLUL
2022-12-07 14:36:54,852 - root - INFO - Error while getting the response: 'Chatbot' object has no attribute 'headers'
2022-12-07 14:37:35,805 - root - INFO - User @Archnet is not allowed to start the bot
2022-12-07 14:37:43,588 - root - INFO - Bot started
2022-12-07 14:37:47,411 - root - INFO - New message received from user @ArchLUL
2022-12-07 14:37:47,516 - root - INFO - Error while getting the response: 'Chatbot' object has no attribute 'headers'
2022-12-07 14:37:54,966 - root - INFO - New message received from user @ArchLUL
2022-12-07 14:37:55,317 - root - INFO - Error while getting the response: 'Chatbot' object has no attribute 'headers'

and in telegram : image What's problem?

acheong08 commented 1 year ago

@EbadiDev Outdated revChatGPT. Do pip3 install --upgrade revChatGPT

n3d1117 commented 1 year ago

Thanks @acheong08!

@EbadiDev just pushed an update, can you do a git pull and check again now?

EbadiDev commented 1 year ago

Well I can't test it anymore, need to wait or create new account because of 'Rate limit hit'

(chatgpt-telegram-bot) root@linux:~/chatgpt-telegram-bot# python main.py
Debugger enabled on OpenAIAuth
Logging in...
Debugger enabled on OpenAIAuth
Beginning auth process
Beginning part two
Beginning part three
Beginning part four
Error in part four
Status code: 302
Rate limit hit
Login failed
Traceback (most recent call last):
  File "/root/.local/share/virtualenvs/chatgpt-telegram-bot-IagjQVk0/lib/python3.10/site-packages/OpenAIAuth/OpenAIAuth.py", line 176, in part_four
    state = re.findall(r"state=(.*)", response.text)[0]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/chatgpt-telegram-bot/main.py", line 32, in <module>
    main()
  File "/root/chatgpt-telegram-bot/main.py", line 26, in main
    gpt3_bot = ChatGPT3Bot(config=chatgpt_config, debug=True)
  File "/root/.local/share/virtualenvs/chatgpt-telegram-bot-IagjQVk0/lib/python3.10/site-packages/revChatGPT/revChatGPT.py", line 32, in __init__
    self.refresh_session()
  File "/root/.local/share/virtualenvs/chatgpt-telegram-bot-IagjQVk0/lib/python3.10/site-packages/revChatGPT/revChatGPT.py", line 212, in refresh_session
    raise exc
  File "/root/.local/share/virtualenvs/chatgpt-telegram-bot-IagjQVk0/lib/python3.10/site-packages/revChatGPT/revChatGPT.py", line 209, in refresh_session
    self.login(self.config["email"], self.config["password"])
  File "/root/.local/share/virtualenvs/chatgpt-telegram-bot-IagjQVk0/lib/python3.10/site-packages/revChatGPT/revChatGPT.py", line 236, in login
    raise exc
  File "/root/.local/share/virtualenvs/chatgpt-telegram-bot-IagjQVk0/lib/python3.10/site-packages/revChatGPT/revChatGPT.py", line 229, in login
    auth.begin()
  File "/root/.local/share/virtualenvs/chatgpt-telegram-bot-IagjQVk0/lib/python3.10/site-packages/OpenAIAuth/OpenAIAuth.py", line 83, in begin
    self.part_two()
  File "/root/.local/share/virtualenvs/chatgpt-telegram-bot-IagjQVk0/lib/python3.10/site-packages/OpenAIAuth/OpenAIAuth.py", line 112, in part_two
    self.part_three(token=csrf_token)
  File "/root/.local/share/virtualenvs/chatgpt-telegram-bot-IagjQVk0/lib/python3.10/site-packages/OpenAIAuth/OpenAIAuth.py", line 144, in part_three
    self.part_four(url=url)
  File "/root/.local/share/virtualenvs/chatgpt-telegram-bot-IagjQVk0/lib/python3.10/site-packages/OpenAIAuth/OpenAIAuth.py", line 184, in part_four
    raise Exception("Rate limit hit")
Exception: Rate limit hit
acheong08 commented 1 year ago

Just need to wait a few minutes for rate limit to reset (normally 1)

acheong08 commented 1 year ago

I'm also getting a rate limit. Might be an issue with their service. Looking into it

acheong08 commented 1 year ago

ChatGPT is down entirely. Their website is also non-responsive for login

acheong08 commented 1 year ago

https://github.com/rawandahmad698/PyChatGPT/issues/38

Confirmed. ChatGPT down

n3d1117 commented 1 year ago

Closing this, should be working now (more or less reliably)