mirror of
https://github.com/SamSanai/VoiceMaster-Discord-Bot.git
synced 2024-11-24 18:59:22 +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.")
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user