From fc470cb1637bcd03f8c0dc529d0055a8452b96dc Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 7 Aug 2021 01:36:05 +0200 Subject: [PATCH] await --- src/cogs/music.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cogs/music.py b/src/cogs/music.py index af83a90..7a62cdd 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 +from wavelink import Client as wClient, errors from discord.ext import commands from utils.core import load @@ -49,10 +49,10 @@ class Music(commands.Cog): async def play(self, ctx, *, query: str): try: tracks = await self.client.wavelink.get_tracks(f"ytsearch:{query}") - except: + except errors.ZeroConnectedNodes: print("bug") - self.start_nodes() - self.play(ctx, query) + await self.start_nodes() + await self.play(ctx, query) if not tracks: return await ctx.send("Je n'ai pas trouvé la musique demandé.")