I need a telegram bot which can send "Hello" every 5 seconds. I tried, but my script does totally nothing. Help me, please
from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
from aiogram.utils import executor
import schedule
bot = Bot(token) #here is my token
dp = Dispatcher(bot)
async def send(message : types.Message):
await message.answer('Hello')
schedule.every(5).seconds.do(send)
executor.start_polling(dp, skip_updates=True)
2
Answers
from time import sleep
This code calls the send function every 5th second 10 times
This code calls the send function basically forever but still in a five-second interval.
have you try websockets?