Replies: 1 comment
-
Не уверен, но вроде бы нужен впн. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i try use this code in my telegram-bot, and have this error:
RuntimeError: this event loop is already running.
Traceback (most recent call last):
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/dispatcher.py", line 309, in _process_update
response = await self.feed_update(bot, update, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/dispatcher.py", line 158, in feed_update
response = await self.update.wrap_outer_middleware(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/middlewares/error.py", line 25, in call
return await handler(event, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/middlewares/user_context.py", line 49, in call
return await handler(event, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/fsm/middleware.py", line 42, in call
return await handler(event, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/event/telegram.py", line 121, in trigger
return await wrapped_inner(event, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/event/handler.py", line 43, in call
return await wrapped()
^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/dispatcher.py", line 276, in _listen_update
return await self.propagate_event(update_type=update_type, event=event, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/router.py", line 142, in propagate_event
return await observer.wrap_outer_middleware(_wrapped, event=event, data=kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/router.py", line 137, in _wrapped
return await self._propagate_event(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/router.py", line 170, in _propagate_event
response = await router.propagate_event(update_type=update_type, event=event, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/router.py", line 142, in propagate_event
return await observer.wrap_outer_middleware(_wrapped, event=event, data=kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/router.py", line 137, in _wrapped
return await self._propagate_event(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/router.py", line 162, in _propagate_event
response = await observer.trigger(event, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/event/telegram.py", line 121, in trigger
return await wrapped_inner(event, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/aiogram/dispatcher/event/handler.py", line 43, in call
return await wrapped()
^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/app/aigpt.py", line 19, in mailing_send
chat_completion = client.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/g4f/client/client.py", line 118, in create
return response if stream else next(response)
^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/g4f/client/client.py", line 57, in iter_append_model_and_provider
for chunk in response:
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/g4f/client/client.py", line 29, in iter_response
for idx, chunk in enumerate(response):
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/g4f/providers/base_provider.py", line 223, in create_completion
yield loop.run_until_complete(await_callback(gen.anext))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 1511, in uvloop.loop.Loop.run_until_complete
File "uvloop/loop.pyx", line 1504, in uvloop.loop.Loop.run_until_complete
File "uvloop/loop.pyx", line 1377, in uvloop.loop.Loop.run_forever
File "uvloop/loop.pyx", line 518, in uvloop.loop.Loop._run
RuntimeError: this event loop is already running.
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-11' coro=<await_callback() done, defined at /home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/g4f/providers/base_provider.py:51> exception=CloudflareError('Response 403: Cloudflare detected')>
Traceback (most recent call last):
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/g4f/providers/base_provider.py", line 52, in await_callback
return await callback()
^^^^^^^^^^^^^^^^
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/g4f/Provider/You.py", line 116, in create_async_generator
await raise_for_status(response)
File "/home/dp/FILES/Server/TelegramBots/dpp/venv/lib/python3.12/site-packages/g4f/requests/raise_for_status.py", line 24, in raise_for_status_async
raise CloudflareError(f"Response {response.status}: Cloudflare detected")
g4f.requests.raise_for_status.CloudflareError: Response 403: Cloudflare detected
Beta Was this translation helpful? Give feedback.
All reactions