From 780c2c6221000609951b5f37f09075912962c934 Mon Sep 17 00:00:00 2001 From: MarkusRost <2701034-MarkusRost@users.noreply.gitlab.com> Date: Wed, 9 Oct 2024 13:50:28 +0000 Subject: [PATCH] Revert "Improve redaction feature mainly for log revdel usage" This reverts commit 2016917cb91a3db57d9c56d2be781f796a62c395 --- src/discord/redaction.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/discord/redaction.py b/src/discord/redaction.py index 19e9aae..911a9d7 100644 --- a/src/discord/redaction.py +++ b/src/discord/redaction.py @@ -76,15 +76,15 @@ def redact_messages(ids, entry_type: int, to_censor: dict): # : Union[List[Unio 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 to_censor.get("user", False) and "url" in new_embed["author"]: + if "user" in to_censor and "url" in new_embed["author"]: new_embed["author"]["name"] = _("hidden") new_embed["author"].pop("url") - if (to_censor.get("action", False) or (to_censor.get("content", False) and entry_type == 1)) and "url" in new_embed: + if "action" in to_censor and "url" in new_embed: new_embed["title"] = _("~~hidden~~") new_embed.pop("url") - if to_censor.get("content", False) and "fields" in new_embed: + if "content" in to_censor and "fields" in new_embed: new_embed.pop("fields") - if to_censor.get("comment", False): + if "comment" in to_censor: new_embed["description"] = _("~~hidden~~") message["embeds"][0] = new_embed db_cursor.execute("UPDATE messages SET content = ? WHERE message_id = ?;", (json.dumps(message), row[1],))