Fixes
This commit is contained in:
parent
58eef9bea0
commit
993d2d600d
2
.idea/SquogBot.iml
generated
2
.idea/SquogBot.iml
generated
@ -4,7 +4,7 @@
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.13 virtualenv at ~/PycharmProjects/SquogBot1/.venv" jdkType="Python SDK" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.13 (SquogBot)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -3,5 +3,5 @@
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.13 (SquogBot)" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13 virtualenv at ~/PycharmProjects/SquogBot1/.venv" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13 (SquogBot)" project-jdk-type="Python SDK" />
|
||||
</project>
|
@ -1,9 +1,8 @@
|
||||
import os
|
||||
import random
|
||||
|
||||
import nextcord
|
||||
from nextcord.ext import commands
|
||||
|
||||
import random
|
||||
|
||||
class Fun(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.client = bot
|
||||
@ -23,4 +22,4 @@ class Fun(commands.Cog):
|
||||
# Add something here later cuz im lazy raaahhh
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(Fun(bot))
|
||||
bot.add_cog(Fun(bot))
|
||||
|
@ -5,6 +5,9 @@ import os
|
||||
import threading
|
||||
|
||||
SquogFinalName: str = None
|
||||
SquogPlaying = {
|
||||
|
||||
}
|
||||
|
||||
SquogVideo = {
|
||||
"verbose": True,
|
||||
@ -43,6 +46,7 @@ class Voice(commands.Cog):
|
||||
if ctx.guild.voice_client:
|
||||
await ctx.guild.voice_client.disconnect(force=True)
|
||||
await ctx.reply("Left.")
|
||||
SquogPlaying[ctx.guild.id] = False
|
||||
else:
|
||||
await ctx.reply("Can't leave as i'm not in any voice channel.")
|
||||
|
||||
@ -53,6 +57,7 @@ class Voice(commands.Cog):
|
||||
if ctx.guild.voice_client.is_playing():
|
||||
return await ctx.reply("I'm already playing music.")
|
||||
# Extracting info for the filename
|
||||
SquogPlaying[ctx.guild.id] = True
|
||||
SquogInfo = SquogDownload.extract_info(link, download=False)
|
||||
|
||||
Embed = nextcord.Embed(title="Loading music", description=SquogDownload.prepare_filename(SquogInfo))
|
||||
@ -77,7 +82,10 @@ class Voice(commands.Cog):
|
||||
SquogEvilFilename = f"{SquogFinalName[:SquogLength]}mp3"
|
||||
|
||||
#Starting the music
|
||||
SquogVoiceClient.play(nextcord.FFmpegPCMAudio(f"{SquogEvilFilename}"))
|
||||
|
||||
while SquogPlaying[ctx.guild.id] == True:
|
||||
SquogVoiceClient.play(nextcord.FFmpegPCMAudio(f"{SquogEvilFilename}"))
|
||||
|
||||
|
||||
# I've to start this in a different thread because of how long some videos take to load...
|
||||
threading.Thread(target=Process).start()
|
||||
@ -89,6 +97,7 @@ class Voice(commands.Cog):
|
||||
if not ctx.guild.voice_client.is_playing():
|
||||
return await ctx.reply("I'm not playing music.")
|
||||
ctx.guild.voice_client.stop()
|
||||
SquogPlaying[ctx.guild.id] = False
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(Voice(bot))
|
Loading…
x
Reference in New Issue
Block a user