aioschedule library not working! because I don’t understand what the problem is. On my PC it works fine, but on your server it starts up and hangs indefinitely, even when the desired time is reached. The code is the following:
import schedule
import time
import urllib.request
from re import findall, split
from aiogram import Bot, types, Dispatcher
from aiogram.dispatcher import Dispatcher
from aiogram.utils import executor
import asyncio
import aioschedule
USER_ID = USER_ID
CHANNEL_ID = CHANNEL_ID
bot = Bot(token = token)
dp = Dispatcher(bot)
LOGIN = LOGIN
PASSWORD = PASSWORD
VK_USER_ID = VK_USER_ID
VK_TOKEN = VK_TOKEN
def captcha_handler(captcha):
key = input("Совершено большое количество запросов, перейдите по ссылке и ввидите капчу с картинки {0}: ".format(captcha.get_url())).strip()
return captcha.try_again(key)
async def on_startup1():
print("1")
async def scheduler():
aioschedule.every().day.at("23:17").do(on_startup1)
while True:
await aioschedule.run_pending()
await asyncio.sleep(1)
async def on_startup(_):
asyncio.create_task(scheduler())
if __name__ == "__main__":
executor.start_polling(dp, skip_updates=True, on_startup=on_startup)
installed the following libraries:
aiogram
, nltk
, schedule
, aioschedule