...
from dragonbot import dg
def start_thread(kit,user_token):
global thread
try:
t = threading.Thread(target=load_kit, name= 'Поток {}'.format(thread), args=('{}'.format(kit),'{}'.format(user_token)))
thread = thread + 1
t.start()
print(t)
send_vk("📌Поток удачно запущен",16736)
except:
send_vk()
def load_kit(kit,token):
p = dg(token)
if kit == 'full':
asyncio.run(p.full())
elif kit == 'aver':
asyncio.run(p.aver())
elif kit == 'mini':
asyncio.run(p.mini())
if __name__ == '__main__':
thread = 0
start_thread("mini","hdhudgv")
class dg(object):
def __init__(self, token):
self.vk_session = vk_api.VkApi(token=token)
self.vk = self.vk_session.get_api()
#Тут остальные функции
async def mini(self):
task_race = asyncio.create_task(self.race(0))
task_business = asyncio.create_task(self.business(60))
task_mining = asyncio.create_task(self.mining(180))
task_job = asyncio.create_task(self.job(360))
await asyncio.gather(task_race, task_business, task_mining, task_job)