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.96k stars 1.36k forks source link

Message is too long #493

Open andruhadranayashluxa opened 8 months ago

andruhadranayashluxa commented 8 months ago

hi,i do all things right and when i start bot and try send him a message(not command) and this is what i get 2023-12-13 17:17:37,552 - root - INFO - New message received from user саша блейдмейл (id: 6915028128) 2023-12-13 17:17:38,769 - root - ERROR - ⚠️ Произошла ошибка. ⚠️ <!DOCTYPE html>

Attention Required! | Cloudflare

Sorry, you have been blocked

You are unable to access api.openai.com

Why have I been blocked?

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?

You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

Traceback (most recent call last): File "C:\chatgpt-telegram-bot-main\bot\openai_helper.py", line 261, in __common_get_chat_response return await self.client.chat.completions.create(**common_args) File "C:\chatgpt-telegram-bot-main\venv\lib\site-packages\openai\resources\chat\completions.py", line 1199, in create return await self._post( File "C:\chatgpt-telegram-bot-main\venv\lib\site-packages\openai_base_client.py", line 1474, in post return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) File "C:\chatgpt-telegram-bot-main\venv\lib\site-packages\openai_base_client.py", line 1275, in request return await self._request( File "C:\chatgpt-telegram-bot-main\venv\lib\site-packages\openai_base_client.py", line 1318, in _request raise self._make_status_error_from_response(err.response) from None openai.PermissionDeniedError: <!DOCTYPE html>

Attention Required! | Cloudflare

Sorry, you have been blocked

You are unable to access api.openai.com

Why have I been blocked?

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?

You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\chatgpt-telegram-bot-main\bot\telegram_bot.py", line 697, in prompt async for content, tokens in stream_response: File "C:\chatgpt-telegram-bot-main\bot\openai_helper.py", line 176, in get_chat_response_stream response = await self.common_get_chat_response(chat_id, query, stream=True) File "C:\chatgpt-telegram-bot-main\venv\lib\site-packages\tenacity_asyncio.py", line 88, in async_wrapped return await fn(*args, **kwargs) File "C:\chatgpt-telegram-bot-main\venv\lib\site-packages\tenacity_asyncio.py", line 47, in call do = self.iter(retry_state=retry_state) File "C:\chatgpt-telegram-bot-main\venv\lib\site-packages\tenacity__init__.py", line 314, in iter return fut.result() File "C:\Users\aagol\AppData\Local\Programs\Python\Python310\lib\concurrent\futures_base.py", line 451, in result return self.get_result() File "C:\Users\aagol\AppData\Local\Programs\Python\Python310\lib\concurrent\futures_base.py", line 403, in get_result raise self._exception File "C:\chatgpt-telegram-bot-main\venv\lib\site-packages\tenacity_asyncio.py", line 50, in call__ result = await fn(*args, **kwargs) File "C:\chatgpt-telegram-bot-main\bot\openai_helper.py", line 270, in __common_get_chatresponse raise Exception(f"⚠️ {localized_text('error', botlanguage)}. ⚠️\n{str(e)}") from e Exception: ⚠️ Произошла ошибка. ⚠️ <!DOCTYPE html>

Attention Required! | Cloudflare

Sorry, you have been blocked

You are unable to access api.openai.com

Why have I been blocked?

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?

You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

2023-12-13 17:17:38,940 - root - ERROR - Exception while handling an update: Message is too long can someone pls help me? Now i see that i have been blocked on api.openai.com but why? is that because im from russia or something?(On mobile phone i use vpn to log in and i successfully get the api normally,but on pc i dont have a vpn)

PavelMorozovskiy commented 8 months ago

Use a proxy

Sindyy3 commented 7 months ago

Мб потому что ты в рф