K
K
Kirill Legend2020-05-08 18:39:50
Python
Kirill Legend, 2020-05-08 18:39:50

Multimodularity of the VK bot in python with the vk_api library. How to implement it correctly?

I remembered the old bot, at the moment there is a garbage dump with 1.2 k lines in one script. I would like to rewrite everything. Each command is executed in a new thread, which slows down the bot. Maybe asynchrony is needed here?
Plus, I want to break each part of the commands into modules, rp, kick-ban, and so on.
How to do it right? In each module, make a handler and process the long pool in a loop?
Or do it in the main script? But there are quite a lot of commands, which will slow down their processing.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question