diff options
| author | 2020-09-30 16:19:29 -0700 | |
|---|---|---|
| committer | 2020-09-30 16:19:29 -0700 | |
| commit | 998ecc6484ab6897310061f9d8b45cb9a534fb0f (patch) | |
| tree | a6fee5605f435582668494f345864be34e620dec | |
| parent | PR #1191 Verification: broaden 50_007 error handling (diff) | |
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
| -rw-r--r-- | bot/exts/moderation/modlog.py | 2 |
1 files changed, 1 insertions, 1 deletions
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, } |