From e0df4bf6ae3c66c8da0332637458d15562c84c7c Mon Sep 17 00:00:00 2001
From: Sami <samip5@users.noreply.github.com>
Date: Wed, 25 Jul 2018 13:43:28 +0300
Subject: [PATCH] Music: Fixed the checks that prevented usage of stop command.

---
 Music-bot/cogs/utils/checks.py | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/Music-bot/cogs/utils/checks.py b/Music-bot/cogs/utils/checks.py
index 336149f..6c1fc2c 100644
--- a/Music-bot/cogs/utils/checks.py
+++ b/Music-bot/cogs/utils/checks.py
@@ -124,18 +124,12 @@ def song_requester_or_owner_or_dj():
 def music_stop_check():
     async def predicate(ctx):
         is_owner = await ctx.bot.is_owner(ctx.author)
-        try:
-            vc = ctx.voice_client
-
-            if ctx.message.author.name == vc.source.requester.name:
-                return True
-            elif is_owner:
-                return True
-            elif discord.utils.get(ctx.message.author.roles, name="DJ"):
-                return True
-            elif ctx.message.author != vc.source.requester or not discord.utils.get(ctx.message.author.roles, name="DJ"):
-                await ctx.send(f"You lack the permissions to use this command, sorry.")
-                return False
-        except AttributeError:
-            pass
+        vc = ctx.voice_client
+        if is_owner:
+            return True
+        elif discord.utils.get(ctx.message.author.roles, name="DJ"):
+            return True
+        elif ctx.message.author != vc.source.requester or not discord.utils.get(ctx.message.author.roles, name="DJ"):
+            await ctx.send(f"You lack the permissions to use this command, sorry.")
+            return False
     return commands.check(predicate)
\ No newline at end of file
-- 
GitLab