diff options
| author | 2021-08-03 12:23:57 +0100 | |
|---|---|---|
| committer | 2021-08-03 12:23:57 +0100 | |
| commit | def62f6129e5b24a52f1cc0cafc616edfa44f3b2 (patch) | |
| tree | 8cf8e03f1a1d2d9c16b10550106ca3b76297168c | |
| parent | Remove bot prefix from docstring and change single quotes to double (diff) | |
Add check for redundant change
| -rw-r--r-- | bot/exts/recruitment/talentpool/_cog.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bot/exts/recruitment/talentpool/_cog.py b/bot/exts/recruitment/talentpool/_cog.py index d2b1d7c02..e7ad314e8 100644 --- a/bot/exts/recruitment/talentpool/_cog.py +++ b/bot/exts/recruitment/talentpool/_cog.py @@ -75,6 +75,10 @@ class TalentPool(WatchChannel, Cog, name="Talentpool"): This will post reviews up to one day overdue. Older nominations can be manually reviewed with the `tp post_review <user_id>` command. """ + if await self.autoreview_enabled(): + await ctx.send(":x: Autoreview is already enabled") + return + await self.talentpool_settings.set(AUTOREVIEW_ENABLED_KEY, True) await self.reviewer.reschedule_reviews() await ctx.send(":white_check_mark: Autoreview enabled") @@ -83,6 +87,10 @@ class TalentPool(WatchChannel, Cog, name="Talentpool"): @has_any_role(Roles.admins) async def autoreview_disable(self, ctx: Context) -> None: """Disable automatic posting of reviews.""" + if not await self.autoreview_enabled(): + await ctx.send(":x: Autoreview is already disabled") + return + await self.talentpool_settings.set(AUTOREVIEW_ENABLED_KEY, False) self.reviewer.cancel_all() await ctx.send(":white_check_mark: Autoreview disabled") |