from aiogram import Bot, Dispatcher
from aiogram.fsm.storage.memory import MemoryStorage
import threading
import logging
import asyncio
import config as cf
from handler.start import start_router
from hand_callback.hand_callback import hand_router
from handler.admin import admin_router
from handler.state_handler import state_handler
from database import queue_silver
logging.basicConfig(level=logging.INFO)
bot = Bot(cf.API)
dp = Dispatcher(storage=MemoryStorage())
async def main():
dp.include_routers(start_router, hand_router, admin_router, state_handler)
thread = threading.Thread(target=queue_silver.checking)
thread.start()
await asyncio.sleep(6)
await dp.start_polling(bot)
if __name__ == '__main__':
print("Бот запущен")
try:
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
except Exception as e:
logging.error(f"An error occurred: {e}")
帮我修复错误
它给出的错误是:
C:\Users\user\AppData\Local\Programs\Python\Python38\lib\threading.py:870:
RuntimeWarning: coroutine 'checking' was never awaited
self._target(*self._args, **self._kwargs)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback