From 82de6f31b774fcd9c81b40afdd93e32f1a00d2fc Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 7 Aug 2021 02:31:00 +0200 Subject: [PATCH] removes tests --- src/cogs/music.py | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) 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é.")