diff options
| author | 2021-10-14 21:47:22 +0100 | |
|---|---|---|
| committer | 2021-10-14 21:47:22 +0100 | |
| commit | 7c4e92849b45871cb23a6c88aadb5b3316401f22 (patch) | |
| tree | 016c26b83d7f4e4ff481e0ba6970c6ebdeb63c41 | |
| parent | Merge branch 'main' into fix-infract-then-dm (diff) | |
| parent | Send the user's mention in the `watch` command. (#1867) (diff) | |
Merge branch 'main' into fix-infract-then-dm
| -rw-r--r-- | bot/exts/moderation/infraction/management.py | 7 | ||||
| -rw-r--r-- | bot/exts/moderation/watchchannels/bigbrother.py | 8 | 
2 files changed, 8 insertions, 7 deletions
| diff --git a/bot/exts/moderation/infraction/management.py b/bot/exts/moderation/infraction/management.py index 0cb2a8b60..dd44f7dd0 100644 --- a/bot/exts/moderation/infraction/management.py +++ b/bot/exts/moderation/infraction/management.py @@ -141,10 +141,11 @@ class ModManagement(commands.Cog):          log_text = ""          if duration is not None and not infraction['active']: -            if reason is None: +            if (infr_type := infraction['type']) in ('note', 'warning'): +                await ctx.send(f":x: Cannot edit the expiration of a {infr_type}.") +            else:                  await ctx.send(":x: Cannot edit the expiration of an expired infraction.") -                return -            confirm_messages.append("expiry unchanged (infraction already expired)") +            return          elif isinstance(duration, str):              request_data['expires_at'] = None              confirm_messages.append("marked as permanent") diff --git a/bot/exts/moderation/watchchannels/bigbrother.py b/bot/exts/moderation/watchchannels/bigbrother.py index 3aa253fea..b91b9a124 100644 --- a/bot/exts/moderation/watchchannels/bigbrother.py +++ b/bot/exts/moderation/watchchannels/bigbrother.py @@ -87,11 +87,11 @@ class BigBrother(WatchChannel, Cog, name="Big Brother"):              return          if not await self.fetch_user_cache(): -            await ctx.send(f":x: Updating the user cache failed, can't watch user {user}") +            await ctx.send(f":x: Updating the user cache failed, can't watch user {user.mention}")              return          if user.id in self.watched_users: -            await ctx.send(f":x: {user} is already being watched.") +            await ctx.send(f":x: {user.mention} is already being watched.")              return          # discord.User instances don't have a roles attribute @@ -103,7 +103,7 @@ class BigBrother(WatchChannel, Cog, name="Big Brother"):          if response is not None:              self.watched_users[user.id] = response -            msg = f":white_check_mark: Messages sent by {user} will now be relayed to Big Brother." +            msg = f":white_check_mark: Messages sent by {user.mention} will now be relayed to Big Brother."              history = await self.bot.api_client.get(                  self.api_endpoint, @@ -156,7 +156,7 @@ class BigBrother(WatchChannel, Cog, name="Big Brother"):                  log.debug(f"Perma-banned user {user} was unwatched.")                  return              log.trace("User is not banned.  Sending message to channel") -            message = f":white_check_mark: Messages sent by {user} will no longer be relayed." +            message = f":white_check_mark: Messages sent by {user.mention} will no longer be relayed."          else:              log.trace("No active watches found for user.") | 
