await
This commit is contained in:
parent
640372959f
commit
fc470cb163
1 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
import discord
|
import discord
|
||||||
from subprocess import Popen, DEVNULL
|
from subprocess import Popen, DEVNULL
|
||||||
from wavelink import Client as wClient
|
from wavelink import Client as wClient, errors
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from utils.core import load
|
from utils.core import load
|
||||||
|
|
||||||
|
@ -49,10 +49,10 @@ class Music(commands.Cog):
|
||||||
async def play(self, ctx, *, query: str):
|
async def play(self, ctx, *, query: str):
|
||||||
try:
|
try:
|
||||||
tracks = await self.client.wavelink.get_tracks(f"ytsearch:{query}")
|
tracks = await self.client.wavelink.get_tracks(f"ytsearch:{query}")
|
||||||
except:
|
except errors.ZeroConnectedNodes:
|
||||||
print("bug")
|
print("bug")
|
||||||
self.start_nodes()
|
await self.start_nodes()
|
||||||
self.play(ctx, query)
|
await self.play(ctx, query)
|
||||||
|
|
||||||
if not tracks:
|
if not tracks:
|
||||||
return await ctx.send("Je n'ai pas trouvé la musique demandé.")
|
return await ctx.send("Je n'ai pas trouvé la musique demandé.")
|
||||||
|
|
Reference in a new issue