mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Fix #179
This commit is contained in:
parent
33406db790
commit
fde707e2ea
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue