diff --git a/src/cogs/music.py b/src/cogs/music.py index 7a62cdd..40aebec 100644 --- a/src/cogs/music.py +++ b/src/cogs/music.py @@ -1,6 +1,6 @@ import discord from subprocess import Popen, DEVNULL -from wavelink import Client as wClient, errors +from wavelink import Client as wClient from discord.ext import commands from utils.core import load @@ -23,15 +23,13 @@ class Music(commands.Cog): async def start_nodes(self): await self.client.wait_until_ready() - try: - await self.client.wavelink.initiate_node(host = "0.0.0.0", - port = 2333, - rest_uri = "http://0.0.0.0:2333", - password = "youshallnotpass", - identifier = "PROD", - region = self.keys["REGION_DISCORD"]) - except: - await self.start_nodes() + + await self.client.wavelink.initiate_node(host = "0.0.0.0", + port = 2333, + rest_uri = "http://0.0.0.0:2333", + password = "youshallnotpass", + identifier = "PROD", + region = self.keys["REGION_DISCORD"]) @commands.command(name='connect') async def connect_(self, ctx, *, channel: discord.VoiceChannel = None): @@ -47,12 +45,7 @@ class Music(commands.Cog): @commands.command() async def play(self, ctx, *, query: str): - try: - tracks = await self.client.wavelink.get_tracks(f"ytsearch:{query}") - except errors.ZeroConnectedNodes: - print("bug") - await self.start_nodes() - await self.play(ctx, query) + tracks = await self.client.wavelink.get_tracks(f"ytsearch:{query}") if not tracks: return await ctx.send("Je n'ai pas trouvé la musique demandé.")