[Audio] Move DJ role check in [p]summon (#2799)

This commit is contained in:
aikaterna 2019-06-26 17:48:06 -07:00 committed by Toby Harradine
parent 49819a2eeb
commit a0f34bbbd9

View File

@ -3511,6 +3511,9 @@ class Audio(commands.Cog):
async def summon(self, ctx): async def summon(self, ctx):
"""Summon the bot to a voice channel.""" """Summon the bot to a voice channel."""
dj_enabled = await self.config.guild(ctx.guild).dj_enabled() dj_enabled = await self.config.guild(ctx.guild).dj_enabled()
if dj_enabled:
if not await self._can_instaskip(ctx, ctx.author):
return await self._embed_msg(ctx, _("You need the DJ role to summon the bot."))
try: try:
if ( if (
not ctx.author.voice.channel.permissions_for(ctx.me).connect not ctx.author.voice.channel.permissions_for(ctx.me).connect
@ -3535,9 +3538,6 @@ class Audio(commands.Cog):
return await self._embed_msg( return await self._embed_msg(
ctx, _("Connection to Lavalink has not yet been established.") ctx, _("Connection to Lavalink has not yet been established.")
) )
if dj_enabled:
if not await self._can_instaskip(ctx, ctx.author):
return await self._embed_msg(ctx, _("You need the DJ role to summon the bot."))
@commands.command() @commands.command()
@commands.guild_only() @commands.guild_only()