The aioschedule library does not work or another error

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

I’m sorry, I bother you in vain, the problem was that I tried to call the time function in Moscow, since I’m from Russia and the replit server is in another country, the difference is 3 hours, code did everything right, it remains only to change the time

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

It was no problem @Zemlyanin thank you for marking your issue as resolved.