Fix issue with permissions being reset on channel lock

This commit is contained in:
Rodry 2021-04-09 17:58:28 +01:00
parent 20a60d90c4
commit 6209c8f1d5
1 changed files with 4 additions and 4 deletions

View File

@ -162,9 +162,9 @@ class voice(commands.Cog):
await ctx.channel.send(f"{ctx.author.mention} You don't own a channel.")
else:
channelID = voice[0]
role = discord.utils.get(ctx.guild.roles, name='@everyone')
role = ctx.guild.default_role
channel = self.bot.get_channel(channelID)
await channel.set_permissions(role, connect=False,read_messages=True)
await channel.set_permissions(role, connect=False)
await ctx.channel.send(f'{ctx.author.mention} Voice chat locked! 🔒')
conn.commit()
conn.close()
@ -180,9 +180,9 @@ class voice(commands.Cog):
await ctx.channel.send(f"{ctx.author.mention} You don't own a channel.")
else:
channelID = voice[0]
role = discord.utils.get(ctx.guild.roles, name='@everyone')
role = ctx.guild.default_role
channel = self.bot.get_channel(channelID)
await channel.set_permissions(role, connect=True,read_messages=True)
await channel.set_permissions(role, connect=True)
await ctx.channel.send(f'{ctx.author.mention} Voice chat unlocked! 🔓')
conn.commit()
conn.close()