From a8b4e394d9da57287cd9497cd9bb0a97fa467e84 Mon Sep 17 00:00:00 2001 From: kwzrd Date: Sat, 20 Jun 2020 14:02:48 +0200 Subject: Incidents: de-clyde archive webhook username With PR #1009 merged, we now apply the same fix to our relay function. This prevents the "clyde" word from sneaking into the webhook username, which is forbidden and will return a 400. --- bot/cogs/moderation/incidents.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/cogs/moderation/incidents.py b/bot/cogs/moderation/incidents.py index 41a98bcb7..040f2c0c8 100644 --- a/bot/cogs/moderation/incidents.py +++ b/bot/cogs/moderation/incidents.py @@ -8,6 +8,7 @@ from discord.ext.commands import Cog from bot.bot import Bot from bot.constants import Channels, Emojis, Roles, Webhooks +from bot.utils.messages import sub_clyde log = logging.getLogger(__name__) @@ -169,7 +170,7 @@ class Incidents(Cog): # Now relay the incident message: discord.Message = await webhook.send( content=incident.clean_content, # Clean content will prevent mentions from pinging - username=incident.author.name, + username=sub_clyde(incident.author.name), avatar_url=incident.author.avatar_url, wait=True, # This makes the method return the sent Message object ) -- cgit v1.2.3