mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Added #49
This commit is contained in:
parent
85233efbd5
commit
b87248adac
15
rcgcdw.py
15
rcgcdw.py
|
@ -526,21 +526,26 @@ def handle_discord_http(code, formatted_embed):
|
||||||
|
|
||||||
def first_pass(
|
def first_pass(
|
||||||
change, changed_categories): # I've decided to split the embed formatter and change handler, maybe it's more messy this way, I don't know
|
change, changed_categories): # I've decided to split the embed formatter and change handler, maybe it's more messy this way, I don't know
|
||||||
if "actionhidden" in change or "suppressed" in change or "userhidden" in change or "commenthidden" in change and "suppressed" not in settings["ignored"]:
|
if ("actionhidden" in change or "suppressed" in change) and "suppressed" not in settings["ignored"]:
|
||||||
webhook_formatter("suppressed",
|
webhook_formatter("suppressed",
|
||||||
{"timestamp": change["timestamp"], "color": settings["appearance"]["suppressed"]["color"],
|
{"timestamp": change["timestamp"], "color": settings["appearance"]["suppressed"]["color"],
|
||||||
"icon": settings["appearance"]["suppressed"]["icon"]}, user=change["user"])
|
"icon": settings["appearance"]["suppressed"]["icon"]}, user=change["user"])
|
||||||
return
|
return
|
||||||
LinkParser.feed(change["parsedcomment"])
|
if "commenthidden" not in change:
|
||||||
# parsedcomment = (BeautifulSoup(change["parsedcomment"], "lxml")).get_text()
|
LinkParser.feed(change["parsedcomment"])
|
||||||
parsedcomment = LinkParser.new_string
|
# parsedcomment = (BeautifulSoup(change["parsedcomment"], "lxml")).get_text()
|
||||||
LinkParser.new_string = ""
|
parsedcomment = LinkParser.new_string
|
||||||
|
LinkParser.new_string = ""
|
||||||
|
else:
|
||||||
|
parsedcomment = _("~~hidden~~")
|
||||||
logging.debug(change)
|
logging.debug(change)
|
||||||
STATIC_VARS = {"timestamp": change["timestamp"], "tags": change["tags"], "redirect": (True if "redirect" in change else False), "ipaction": (True if "anon" in change else False), "changed_categories": changed_categories}
|
STATIC_VARS = {"timestamp": change["timestamp"], "tags": change["tags"], "redirect": (True if "redirect" in change else False), "ipaction": (True if "anon" in change else False), "changed_categories": changed_categories}
|
||||||
if not parsedcomment:
|
if not parsedcomment:
|
||||||
parsedcomment = _("No description provided")
|
parsedcomment = _("No description provided")
|
||||||
if change["type"] == "edit" and "edit" not in settings["ignored"]:
|
if change["type"] == "edit" and "edit" not in settings["ignored"]:
|
||||||
logging.debug("List of categories in first_pass: {}".format(changed_categories))
|
logging.debug("List of categories in first_pass: {}".format(changed_categories))
|
||||||
|
if "userhidden" in change:
|
||||||
|
change["user"] = _("hidden")
|
||||||
STATIC_VARS = {**STATIC_VARS, **{"color": settings["appearance"]["edit"]["color"],
|
STATIC_VARS = {**STATIC_VARS, **{"color": settings["appearance"]["edit"]["color"],
|
||||||
"icon": settings["appearance"]["edit"]["icon"]}}
|
"icon": settings["appearance"]["edit"]["icon"]}}
|
||||||
webhook_formatter("edit", STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment,
|
webhook_formatter("edit", STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment,
|
||||||
|
|
Loading…
Reference in a new issue