Хочу отправить каждый день в определенное время отправить сообщение подписчикам. Использую библиотеку schedule и aiogram
from aiogram import Bot, Dispatcher
from aiogram.types import *
from aiogram.utils import executor
import schedule
bot = Bot()
dp = Dispatcher(bot)
async def send_message():
await [email protected]_handler(commands=['start'])
async def start(message : Message):
await bot.send_photo(message.chat.id, open('static/img/qq.jpg', 'rb'))
await schedule.every().day.at("10:30").do(send_message)
while True:
schedule.run_pending()
time.sleep(1)
if __name__ == "__main__":
executor.start_polling(dp, skip_updates=True)