Answer the question
In order to leave comments, you need to log in
How to make LoopWrapper + VKBOTTLE blueprints work?
I can't figure out how to make it work.
Since each of these modules is run by run_forever
from vkbottle import Bot, load_blueprints_from_package
from config import token
import logging
bot = Bot(token)
logging.basicConfig(level=logging.DEBUG)
for bp in load_blueprints_from_package("blueprints"):
bp.load(bot)
bot.run_forever()
from vkbottle import LoopWrapper
lw = LoopWrapper()
@lw.interval(seconds=5)
async def work_check():
print("Work")
Answer the question
In order to leave comments, you need to log in
First, import the lw variable from the file and write bot.loop_wrapper = lw before bot.run_forever()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question