remove sleep

This commit is contained in:
Mylloon 2021-08-06 17:06:49 +02:00
parent 77255a841a
commit bc042a0485

View file

@ -2,7 +2,6 @@ import discord
from subprocess import Popen, DEVNULL from subprocess import Popen, DEVNULL
from wavelink import Client as wClient from wavelink import Client as wClient
from discord.ext import commands from discord.ext import commands
from time import sleep
from utils.core import load from utils.core import load
def setup(client): def setup(client):
@ -12,8 +11,8 @@ class Music(commands.Cog):
"""Commandes relatives à la musique.""" """Commandes relatives à la musique."""
def __init__(self, client): def __init__(self, client):
self.client = client self.client = client
print("Démarrage du serveur Lavalink...", end = " ")
self.keys = load(["REGION_DISCORD"]) self.keys = load(["REGION_DISCORD"])
print("Démarrage du serveur Lavalink...", end = " ")
Popen(['java', '-jar', 'Lavalink.jar'], stdout = DEVNULL) Popen(['java', '-jar', 'Lavalink.jar'], stdout = DEVNULL)
print("Lavalink prêt") print("Lavalink prêt")
@ -24,7 +23,6 @@ class Music(commands.Cog):
async def start_nodes(self): async def start_nodes(self):
await self.client.wait_until_ready() await self.client.wait_until_ready()
sleep(10) # pour être sur que lavalink est le temps de démarré correctement
await self.client.wavelink.initiate_node(host = "127.0.0.1", await self.client.wavelink.initiate_node(host = "127.0.0.1",
port = 2333, port = 2333,