diff --git a/Music-bot/cogs/misc.py b/Music-bot/cogs/misc.py index 23bbbdf9e572a5a91bd7c0d461149cd5f5acfb0e..83c12d94b9c043464eb320fc899ddb9e089f8d55 100644 --- a/Music-bot/cogs/misc.py +++ b/Music-bot/cogs/misc.py @@ -6,7 +6,7 @@ class Misc: def __init__(self, bot): self.bot = bot - @commands.command(name='top_role', aliases=['toprole'], pass_context=True, hidden=False) + @commands.command(name='top_role', aliases=['toprole'], pass_context=True) async def show_toprole(self, ctx, *, member: discord.Member = None): """Simple command which shows the members Top Role.""" diff --git a/Music-bot/cogs/utils/checks.py b/Music-bot/cogs/utils/checks.py index bfb23d67ef954c94d871244f79f7272f527c63f7..ab78f4eaa3f5c8c51dd187cfb69739a24160c315 100644 --- a/Music-bot/cogs/utils/checks.py +++ b/Music-bot/cogs/utils/checks.py @@ -85,18 +85,17 @@ def admin_or_permissions(**perms): def song_requester_or_dj(): async def predicate(ctx): vc = ctx.voice_client - - if not vc or not vc.is_connected(): - await ctx.send('I am not currently connected to voice!') - - if ctx.message.author.name == vc.source.requester.name: - 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"The bot owner has been naughty and has failed to add a voting system, so sorry but your " - f"permissions are not enough to use this command.") - return False + try: + if ctx.message.author.name == vc.source.requester.name: + 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"The bot owner has been naughty and has failed to add a voting system, so sorry but your " + f"permissions are not enough to use this command.") + return False + except AttributeError: + pass return commands.check(predicate)