diff options
| -rw-r--r-- | bot/exts/moderation/watchchannels/_watchchannel.py | 5 | ||||
| -rw-r--r-- | bot/exts/moderation/watchchannels/talentpool.py | 10 | 
2 files changed, 9 insertions, 6 deletions
| diff --git a/bot/exts/moderation/watchchannels/_watchchannel.py b/bot/exts/moderation/watchchannels/_watchchannel.py index f9fc12dc3..d1e976190 100644 --- a/bot/exts/moderation/watchchannels/_watchchannel.py +++ b/bot/exts/moderation/watchchannels/_watchchannel.py @@ -285,7 +285,10 @@ class WatchChannel(metaclass=CogABCMeta):          else:              message_jump = f"in [#{msg.channel.name}]({msg.jump_url})" -        footer = f"Added {time_delta} by {actor} | Reason: {reason}" +        # Add reason to the footer if it exists. +        footer = f"Added {time_delta} by {actor}" +        if reason: +            footer += f" | Reason: {reason}"          embed = Embed(description=f"{msg.author.mention} {message_jump}")          embed.set_footer(text=textwrap.shorten(footer, width=128, placeholder="...")) diff --git a/bot/exts/moderation/watchchannels/talentpool.py b/bot/exts/moderation/watchchannels/talentpool.py index a77dbe156..7004b559a 100644 --- a/bot/exts/moderation/watchchannels/talentpool.py +++ b/bot/exts/moderation/watchchannels/talentpool.py @@ -1,7 +1,7 @@  import logging  import textwrap  from collections import ChainMap -from typing import Union +from typing import Optional, Union  from discord import Color, Embed, Member, User  from discord.ext.commands import Cog, Context, group, has_any_role @@ -64,12 +64,12 @@ class TalentPool(WatchChannel, Cog, name="Talentpool"):      @nomination_group.command(name='watch', aliases=('w', 'add', 'a'), root_aliases=("nominate",))      @has_any_role(*STAFF_ROLES) -    async def watch_command(self, ctx: Context, user: FetchedMember, *, reason: str) -> None: +    async def watch_command(self, ctx: Context, user: FetchedMember, *, reason: Optional[str] = '') -> None:          """          Relay messages sent by the given `user` to the `#talent-pool` channel. -        A `reason` for adding the user to the talent pool is required and will be displayed -        in the header when relaying messages of this user to the channel. +        A `reason` for adding the user to the talent pool is optional. +        If given, it will be displayed in the header when relaying messages of this user to the channel.          """          if user.bot:              await ctx.send(f":x: I'm sorry {ctx.author}, I'm afraid I can't do that. I only watch humans.") @@ -202,7 +202,7 @@ class TalentPool(WatchChannel, Cog, name="Talentpool"):              f"{self.api_endpoint}/{nomination_id}",              json={field: reason}          ) - +        await self.fetch_user_cache()  # Update cache.          await ctx.send(f":white_check_mark: Updated the {field} of the nomination!")      @Cog.listener() | 
