Put music loading in a different process again
This commit is contained in:
parent
a5385b2c38
commit
4c7a5225da
@ -9,6 +9,7 @@ class Fun(commands.Cog):
|
|||||||
@commands.command()
|
@commands.command()
|
||||||
async def boop(self, ctx: nextcord.Message, user: nextcord.User):
|
async def boop(self, ctx: nextcord.Message, user: nextcord.User):
|
||||||
await ctx.reply(f"{user.mention} shall get booped!", files=[nextcord.File("./images/boop.webp")])
|
await ctx.reply(f"{user.mention} shall get booped!", files=[nextcord.File("./images/boop.webp")])
|
||||||
|
|
||||||
# Add something here later cuz im lazy raaahhh
|
# Add something here later cuz im lazy raaahhh
|
||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
|
@ -55,10 +55,16 @@ class Voice(commands.Cog):
|
|||||||
return await ctx.reply("I'm not in a voice channel.")
|
return await ctx.reply("I'm not in a voice channel.")
|
||||||
if ctx.guild.voice_client.is_playing():
|
if ctx.guild.voice_client.is_playing():
|
||||||
return await ctx.reply("I'm already playing music.")
|
return await ctx.reply("I'm already playing music.")
|
||||||
SquogVoiceClient = ctx.guild.voice_client
|
# Extracting info for the filename
|
||||||
print(link)
|
|
||||||
SquogDownload.download(link)
|
|
||||||
SquogInfo = SquogDownload.extract_info(link, download=False)
|
SquogInfo = SquogDownload.extract_info(link, download=False)
|
||||||
|
Embed = nextcord.Embed(title="Loading music", description=SquogDownload.prepare_filename(SquogInfo))
|
||||||
|
# Notifying the user that music is getting started so they know its there
|
||||||
|
await ctx.reply(embed=Embed)
|
||||||
|
|
||||||
|
SquogVoiceClient = ctx.guild.voice_client
|
||||||
|
|
||||||
|
def Test():
|
||||||
|
SquogDownload.download(link)
|
||||||
SquogFinalName = SquogDownload.prepare_filename(SquogInfo)
|
SquogFinalName = SquogDownload.prepare_filename(SquogInfo)
|
||||||
SquogLength = SquogFinalName.__len__() - 4
|
SquogLength = SquogFinalName.__len__() - 4
|
||||||
SquogExt = os.path.splitext(SquogFinalName)
|
SquogExt = os.path.splitext(SquogFinalName)
|
||||||
@ -68,6 +74,7 @@ class Voice(commands.Cog):
|
|||||||
SquogEvilFilename = f"{SquogFinalName[:SquogLength]}mp3"
|
SquogEvilFilename = f"{SquogFinalName[:SquogLength]}mp3"
|
||||||
SquogVoiceClient.play(nextcord.FFmpegPCMAudio(f"{SquogEvilFilename}"))
|
SquogVoiceClient.play(nextcord.FFmpegPCMAudio(f"{SquogEvilFilename}"))
|
||||||
|
|
||||||
|
multiprocessing.Process(target=Test).start()
|
||||||
|
|
||||||
@commands.command(description="Stops the music in voice channel")
|
@commands.command(description="Stops the music in voice channel")
|
||||||
async def stop(self, ctx: nextcord.Message):
|
async def stop(self, ctx: nextcord.Message):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user