T
T
TraVL322022-03-12 17:56:33
In contact with
TraVL32, 2022-03-12 17:56:33

How to run a bot with Loop Wrapper on VK Bottle?

The code:

lw = LoopWrapper()

@lw.interval(seconds=1)
async def repeated_task():
    print("тест")

bot.run_forever()
lw.run_forever()


How to run loop wrapper on vkbottle if code is not executed after bot.run_forever() ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WolfInChains, 2022-03-21
@TraVL32

Why do you need a new LoopWrapper if it has already been created in the Bot?

@bot.loop_wrapper.interval(seconds=1)
async def repeated_task():
    print("тест")

bot.run_forever()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question