diff options
| author | 2021-02-14 04:34:02 +0200 | |
|---|---|---|
| committer | 2021-02-14 04:34:02 +0200 | |
| commit | abc3f1a30b60981f90acf2065507179010b39713 (patch) | |
| tree | 5e3f2c43e6bea0e610ba53a35287a6010d7e4f34 | |
| parent | Prevent channel description edit from locking commands (diff) | |
_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.
| -rw-r--r-- | bot/exts/moderation/defcon.py | 6 | 
1 files 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) | 
