From 4cfa321a534b57261534ab1c32037d26b86eb69c Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Aug 2021 19:29:49 +0200 Subject: [PATCH] fix when no controller --- src/cogs/music.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/cogs/music.py b/src/cogs/music.py index 3f5a070..3baa900 100644 --- a/src/cogs/music.py +++ b/src/cogs/music.py @@ -163,7 +163,7 @@ class Player(wavelink.Player): embed.add_field(name="Volume", value=f"**`{self.volume}%`**") embed.add_field(name="Demandé par", value=track.requester.mention) embed.add_field(name="DJ", value=self.dj.mention) - embed.add_field(name="Lien de la vidéo", value=f"[Clique ici]({track.uri})") + embed.add_field(name="Lien vidéo", value=f"[Clique ici]({track.uri})") return embed @@ -180,12 +180,13 @@ class Player(wavelink.Player): async def teardown(self): """Clear internal states, remove player controller and disconnect.""" - try: - await self.controller.message.delete() - except discord.HTTPException: - pass + if self.controller: + try: + await self.controller.message.delete() + except discord.HTTPException: + pass - self.controller.stop() + self.controller.stop() try: await self.destroy() @@ -481,7 +482,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin): if channel is None: raise NoChannelProvided - await player.connect(channel.id) + await player.connect(channel.id, self_deaf = True) await ctx.send(f":thumbsup: **Connecté à __{channel.name}__**") if fromSlash != True: return await addReaction(ctx.message, 1)