This commit is contained in:
Frisk 2020-12-01 12:47:15 +01:00
parent 33406db790
commit fde707e2ea
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -55,13 +55,16 @@ def redact_messages(ids: list, entry_type: int, to_censor: dict):
except ValueError:
logger.error("Couldn't loads JSON for message data. What happened? Data: {}".format(row[0]))
return
if "user" in to_censor:
except TypeError:
logger.error("Couldn't find entry in the database for RevDel to censor information. This is probably because the script has been recently restarted or cache cleared.")
return
if "user" in to_censor and "url" in new_embed["author"]:
new_embed["author"]["name"] = _("Removed")
new_embed["author"].pop("url")
if "action" in to_censor:
if "action" in to_censor and "url" in new_embed:
new_embed["title"] = _("Removed")
new_embed.pop("url")
if "content" in to_censor:
if "content" in to_censor and "fields" in new_embed:
new_embed.pop("fields")
if "comment" in to_censor:
new_embed["description"] = _("Removed")