INFO:aiogram:Bot: Test Text [@Test_Text_Bot_Test_Text_Bot]
WARNING:aiogram:Goodbye!
Traceback (most recent call last):
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\app.py", line 24, in <module>
executor.start_polling(dp, on_startup=on_startup)
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\aiogram\utils\executor.py", line 45, in start_polling
executor.start_polling(
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\aiogram\utils\executor.py", line 320, in start_polling
loop.run_until_complete(self._startup_polling())
File "C:\Users\lyapi\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\aiogram\utils\executor.py", line 377, in _startup_polling
await callback(self.dispatcher)
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\app.py", line 16, in on_startup
await init()
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\db\init.py", line 8, in init
await Tortoise.generate_schemas()
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\tortoise\__init__.py", line 640, in generate_schemas
await generate_schema_for_client(connection, safe)
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\tortoise\utils.py", line 31, in generate_schema_for_client
await generator.generate_from_string(schema)
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\tortoise\backends\base\schema_generator.py", line 448, in generate_from_string
await self.client.execute_script(creation_string)
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\tortoise\backends\base_postgres\client.py", line 34, in _translate_exceptions
return await self._translate_exceptions(func, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\tortoise\backends\asyncpg\client.py", line 82, in _translate_exceptions
return await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\tortoise\backends\base_postgres\client.py", line 150, in execute_script
async with self.acquire_connection() as connection:
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\tortoise\backends\base\client.py", line 326, in __aenter__
await self.ensure_connection()
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\tortoise\backends\base\client.py", line 322, in ensure_connection
await self.client.create_connection(with_db=True)
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\tortoise\backends\asyncpg\client.py", line 59, in create_connection
self._pool = await self.create_pool(password=self.password, **self._template)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\tortoise\backends\asyncpg\client.py", line 65, in create_pool
return await asyncpg.create_pool(None, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\asyncpg\pool.py", line 403, in _async__init__
await self._initialize()
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\asyncpg\pool.py", line 430, in _initialize
await first_ch.connect()
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\asyncpg\pool.py", line 128, in connect
self._con = await self._pool._get_new_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\asyncpg\pool.py", line 502, in _get_new_connection
con = await connection.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\asyncpg\connection.py", line 2329, in connect
return await connect_utils._connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\asyncpg\connect_utils.py", line 1017, in _connect
raise last_error or exceptions.TargetServerAttributeNotMatched(
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\asyncpg\connect_utils.py", line 991, in _connect
conn = await _connect_addr(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\asyncpg\connect_utils.py", line 828, in _connect_addr
return await __connect_addr(params, True, *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\asyncpg\connect_utils.py", line 873, in __connect_addr
tr, pr = await connector
^^^^^^^^^^^^^^^
File "C:\Users\lyapi\Desktop\Авито Коды\XENIA_LINKS_BOT\venv\Lib\site-packages\asyncpg\connect_utils.py", line 744, in _create_ssl_connection
tr, pr = await loop.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lyapi\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1085, in create_connection
raise exceptions[0]
File "C:\Users\lyapi\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1069, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lyapi\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 973, in _connect_sock
await self.sock_connect(sock, address)
File "C:\Users\lyapi\AppData\Local\Programs\Python\Python311\Lib\asyncio\proactor_events.py", line 726, in sock_connect
return await self._proactor.connect(sock, address)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lyapi\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 846, in _poll
value = callback(transferred, key, ov)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lyapi\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 633, in finish_connect
ov.getresult()
ConnectionRefusedError: [WinError 1225] Удаленный компьютер отклонил это сетевое подключение
i: int = 0
for it in result['rows']:
if i == 1000:
break
if 'без ЧЗ' not in result['rows'][i]['pathName']:
await GeneralData.create(name=result['rows'][i]['name'], pathname=result['rows'][i]['pathName'])
print(result['rows'][i]['name'], '///', result['rows'][i]['pathName'])
i += 1
list_check: list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
for item in list_check:
url = f""
response = requests.get(url=url, auth=auth, headers=headers)
result = response.json()
i = 0
for it in result['rows']:
if 'без ЧЗ' not in result['rows'][i]['pathName']:
await GeneralData.create(name=result['rows'][i]['name'], pathname=result['rows'][i]['pathName'])
i += 1
await GeneralData.create(name=result['rows'][i]['name'], pathname=result['rows'][i]['pathName'])
from tortoise import Tortoise
db = Tortoise()
async def init():
await Tortoise.init(db_url='sqlite://db.sqlite3', modules={'models': ['db.models']})
await Tortoise.generate_schemas()
async def on_shutdown():
await db.close_connections()
dp.bot.send_invoice(chat_id=call.from_user.id,
File "C:\Users\lyapi\Desktop\Авито Коды\lotteryBBOOTT2\LotteryBot\handlers\payment.py", line 18, in pay_sub_now
await dp.send_invoice(chat_id=call.from_user.id,
^^^^^^^^^^^^^^^
AttributeError: 'Dispatcher' object has no attribute 'send_invoice'
Сейчас протестил, все работает