diff options
| author | 2019-10-01 18:23:28 -0700 | |
|---|---|---|
| committer | 2019-10-01 18:25:35 -0700 | |
| commit | fea0bb36e77774a2bbac3da9ff5d43922d1ba1df (patch) | |
| tree | cc80cb814c60abaa8fd4e1b338700c0d65f88ae9 | |
| parent | Tidy up imports (diff) | |
Add an optional icon_url parameter with a default to notify_infraction
| -rw-r--r-- | bot/cogs/moderation/infractions.py | 2 | ||||
| -rw-r--r-- | bot/cogs/moderation/utils.py | 4 | 
2 files changed, 3 insertions, 3 deletions
| diff --git a/bot/cogs/moderation/infractions.py b/bot/cogs/moderation/infractions.py index 0b5d2bfb0..85d29cbd8 100644 --- a/bot/cogs/moderation/infractions.py +++ b/bot/cogs/moderation/infractions.py @@ -348,7 +348,7 @@ class Infractions(Scheduler, commands.Cog):              await self.bot.fetch_user(user.id)              # Accordingly display whether the user was successfully notified via DM. -            if await utils.notify_infraction(user, infr_type, expiry, reason): +            if await utils.notify_infraction(user, infr_type, expiry, reason, icon):                  dm_result = ":incoming_envelope: "                  dm_log_text = "\nDM: Sent"              else: diff --git a/bot/cogs/moderation/utils.py b/bot/cogs/moderation/utils.py index f951d39ba..a4e258d11 100644 --- a/bot/cogs/moderation/utils.py +++ b/bot/cogs/moderation/utils.py @@ -105,7 +105,8 @@ async def notify_infraction(      user: UserTypes,      infr_type: str,      expires_at: t.Optional[str] = None, -    reason: t.Optional[str] = None +    reason: t.Optional[str] = None, +    icon_url: str = Icons.token_removed  ) -> bool:      """DM a user about their new infraction and return True if the DM is successful."""      embed = discord.Embed( @@ -117,7 +118,6 @@ async def notify_infraction(          colour=Colours.soft_red      ) -    icon_url = INFRACTION_ICONS[infr_type][0]      embed.set_author(name="Infraction Information", icon_url=icon_url, url=RULES_URL)      embed.title = f"Please review our rules over at {RULES_URL}"      embed.url = RULES_URL | 
