from aiogram.utils.exceptions import BotBlocked
async def on_startup(dispatcher):
cursor.execute('SELECT user_id FROM test')
arr = cursor.fetchall()
for user_id in arr:
try:
await bot.send_message(chat_id=user_id[0], text="Бот запущен!")
except BotBlocked as E:
pass
await asyncio.sleep(1)