From abc3f1a30b60981f90acf2065507179010b39713 Mon Sep 17 00:00:00 2001 From: mbaruh Date: Sun, 14 Feb 2021 04:34:02 +0200 Subject: _update_channel_topic not longer needs to be awaited It's important to note that it's appropriate for the sync and action methods to have a lock between them, because if an action is made before syncing is complete it gets screwed and starts throwing excpetion for every command. --- bot/exts/moderation/defcon.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/exts/moderation/defcon.py b/bot/exts/moderation/defcon.py index d1b99cb35..3cc8960dd 100644 --- a/bot/exts/moderation/defcon.py +++ b/bot/exts/moderation/defcon.py @@ -95,7 +95,7 @@ class Defcon(Cog): self._update_notifier() log.info(f"DEFCON synchronized: {humanize_delta(self.threshold)}") - await self._update_channel_topic() + self._update_channel_topic() @Cog.listener() async def on_member_join(self, member: Member) -> None: @@ -178,7 +178,7 @@ class Defcon(Cog): await role.edit(reason="DEFCON unshutdown", permissions=permissions) await ctx.send(f"{Action.SERVER_OPEN.value.emoji} Server reopened.") - async def _update_channel_topic(self) -> None: + def _update_channel_topic(self) -> None: """Update the #defcon channel topic with the current DEFCON status.""" new_topic = f"{BASE_CHANNEL_TOPIC}\n(Threshold: {humanize_delta(self.threshold)})" @@ -217,7 +217,7 @@ class Defcon(Cog): f"{humanize_delta(self.threshold)} old to join the server {expiry_message}." ) await self._send_defcon_log(action, author) - await self._update_channel_topic() + self._update_channel_topic() self._log_threshold_stat(threshold) -- cgit v1.2.3