Skip to content

Commit

Permalink
fix(sound)
Browse files Browse the repository at this point in the history
  • Loading branch information
oa01 committed Jul 18, 2024
1 parent 3ec8fd2 commit 2ef477d
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions cogs/sound.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async def earrape(self, ctx):
if self.voice_channel is not None:
self.voice_channel = self.voice_channel.channel
channelname = self.voice_channel.name
await ctx.send(f"Playing in {channelname}")
await ctx.respond(f"Playing in {channelname}")
self.vc = await self.voice_channel.connect()
self.vc.play(discord.FFmpegPCMAudio(source="music/earrape.mp3"))
while self.vc.is_playing():
Expand All @@ -30,8 +30,7 @@ async def earrape(self, ctx):
except:
pass
else:
await ctx.send(f"{ctx.author.name} is not in a channel")
await ctx.message.delete()
await ctx.respond(f"{ctx.author.name} is not in a channel")


@commands.slash_command(guild_ids = [760547427152560160, 1227685392602370088], name="tts")
Expand All @@ -50,7 +49,7 @@ async def tts(self, ctx, text, lang="de"):
if self.voice_channel is not None:
self.voice_channel = self.voice_channel.channel
channelname = self.voice_channel.name
await ctx.send(f"Playing in {channelname}")
await ctx.respond(f"Playing in {channelname}")
self.vc = await self.voice_channel.connect()
self.vc.play(discord.FFmpegPCMAudio(source=full_path))
while self.vc.is_playing():
Expand All @@ -62,22 +61,16 @@ async def tts(self, ctx, text, lang="de"):
except:
pass
else:
await ctx.send(f"{ctx.author.name} is not in a channel")
if ctx.guild:
await ctx.message.delete()
await ctx.respond(f"{ctx.author.name} is not in a channel")

@commands.slash_command(guild_ids = [760547427152560160, 1227685392602370088], name="disconnect", aliases=["dc"])
async def disconnect(self, ctx):
"""
Disconnects the bot from any VC
"""
await self.vc.disconnect()
await ctx.send("Disconnected!")
try:
if ctx.guild:
await ctx.message.delete()
except:
print("No Permissions to delete ctx.message")
await ctx.respond("Disconnected!")



def setup(bot):
Expand Down

0 comments on commit 2ef477d

Please sign in to comment.