removes tests
This commit is contained in:
parent
06d7e9d795
commit
82de6f31b7
1 changed files with 9 additions and 16 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, errors
|
from wavelink import Client as wClient
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from utils.core import load
|
from utils.core import load
|
||||||
|
|
||||||
|
@ -23,15 +23,13 @@ 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()
|
||||||
try:
|
|
||||||
await self.client.wavelink.initiate_node(host = "0.0.0.0",
|
await self.client.wavelink.initiate_node(host = "0.0.0.0",
|
||||||
port = 2333,
|
port = 2333,
|
||||||
rest_uri = "http://0.0.0.0:2333",
|
rest_uri = "http://0.0.0.0:2333",
|
||||||
password = "youshallnotpass",
|
password = "youshallnotpass",
|
||||||
identifier = "PROD",
|
identifier = "PROD",
|
||||||
region = self.keys["REGION_DISCORD"])
|
region = self.keys["REGION_DISCORD"])
|
||||||
except:
|
|
||||||
await self.start_nodes()
|
|
||||||
|
|
||||||
@commands.command(name='connect')
|
@commands.command(name='connect')
|
||||||
async def connect_(self, ctx, *, channel: discord.VoiceChannel = None):
|
async def connect_(self, ctx, *, channel: discord.VoiceChannel = None):
|
||||||
|
@ -47,12 +45,7 @@ class Music(commands.Cog):
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def play(self, ctx, *, query: str):
|
async def play(self, ctx, *, query: str):
|
||||||
try:
|
|
||||||
tracks = await self.client.wavelink.get_tracks(f"ytsearch:{query}")
|
tracks = await self.client.wavelink.get_tracks(f"ytsearch:{query}")
|
||||||
except errors.ZeroConnectedNodes:
|
|
||||||
print("bug")
|
|
||||||
await self.start_nodes()
|
|
||||||
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