From 998ecc6484ab6897310061f9d8b45cb9a534fb0f Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Wed, 30 Sep 2020 16:19:29 -0700 Subject: Remove null chars before posting deleted messages Our API doesn't allow null characters in the content field. It may be present because of a self bot that is able to send such character. Fixes #1182 Fixes BOT-8E --- bot/exts/moderation/modlog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/moderation/modlog.py b/bot/exts/moderation/modlog.py index 41ed46b69..b01de0ee3 100644 --- a/bot/exts/moderation/modlog.py +++ b/bot/exts/moderation/modlog.py @@ -63,7 +63,7 @@ class ModLog(Cog, name="ModLog"): 'id': message.id, 'author': message.author.id, 'channel_id': message.channel.id, - 'content': message.content, + 'content': message.content.replace("\0", ""), # Null chars cause 400. 'embeds': [embed.to_dict() for embed in message.embeds], 'attachments': attachment, } -- cgit v1.2.3