mirror of
https://github.com/SamSanai/VoiceMaster-Discord-Bot.git
synced 2024-11-28 13:00:36 +01:00
Merge pull request #25 from ImRodry/master
Fix issue with permissions being reset on channel lock
This commit is contained in:
commit
1954ea1be2
@ -162,9 +162,9 @@ class voice(commands.Cog):
|
|||||||
await ctx.channel.send(f"{ctx.author.mention} You don't own a channel.")
|
await ctx.channel.send(f"{ctx.author.mention} You don't own a channel.")
|
||||||
else:
|
else:
|
||||||
channelID = voice[0]
|
channelID = voice[0]
|
||||||
role = discord.utils.get(ctx.guild.roles, name='@everyone')
|
role = ctx.guild.default_role
|
||||||
channel = self.bot.get_channel(channelID)
|
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! 🔒')
|
await ctx.channel.send(f'{ctx.author.mention} Voice chat locked! 🔒')
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
@ -180,9 +180,9 @@ class voice(commands.Cog):
|
|||||||
await ctx.channel.send(f"{ctx.author.mention} You don't own a channel.")
|
await ctx.channel.send(f"{ctx.author.mention} You don't own a channel.")
|
||||||
else:
|
else:
|
||||||
channelID = voice[0]
|
channelID = voice[0]
|
||||||
role = discord.utils.get(ctx.guild.roles, name='@everyone')
|
role = ctx.guild.default_role
|
||||||
channel = self.bot.get_channel(channelID)
|
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! 🔓')
|
await ctx.channel.send(f'{ctx.author.mention} Voice chat unlocked! 🔓')
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user