From 901a641f7a4f87e361a63aea375063a72aeac288 Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Mon, 24 Dec 2018 03:26:25 +0300 Subject: [PATCH] lock/unlock: allow locking/unlocking other channels --- cogs/lockdown.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cogs/lockdown.py b/cogs/lockdown.py index 02c4f2b..ac751cc 100644 --- a/cogs/lockdown.py +++ b/cogs/lockdown.py @@ -1,5 +1,6 @@ from discord.ext import commands import config +import discord class Lockdown: @@ -12,8 +13,11 @@ class Lockdown: @commands.guild_only() @commands.check(check_if_staff) @commands.command() - async def lock(self, ctx, soft: bool = False): + async def lock(self, ctx, channel: discord.TextChannel = None, + soft: bool = False): """Prevents people from speaking in current channel, staff only.""" + if not channel: + channel = ctx.channel log_channel = self.bot.get_channel(config.log_channel) if ctx.channel.id in config.community_channels: @@ -43,8 +47,10 @@ class Lockdown: @commands.guild_only() @commands.check(check_if_staff) @commands.command() - async def unlock(self, ctx): + async def unlock(self, ctx, channel: discord.TextChannel = None): """Unlocks speaking in current channel, staff only.""" + if not channel: + channel = ctx.channel log_channel = self.bot.get_channel(config.log_channel) if ctx.channel.id in config.community_channels: