mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
show change on unknown event
This commit is contained in:
parent
d50707ecdd
commit
926747e405
|
@ -2,6 +2,7 @@ import ipaddress
|
|||
import math
|
||||
import re
|
||||
import time
|
||||
import json
|
||||
import logging
|
||||
from src.config import settings
|
||||
from src.misc import link_formatter, create_article_path, parse_link, profile_field_name, ContentParser
|
||||
|
@ -683,8 +684,13 @@ async def embed_formatter(action, change, parsed_comment, categories, recent_cha
|
|||
logger.warning("No entry for {event} with params: {params}".format(event=action, params=change))
|
||||
link = create_article_path("Special:RecentChanges", WIKI_ARTICLE_PATH)
|
||||
embed["title"] = _("Unknown event `{event}`").format(event=action)
|
||||
embed["color"] = 0
|
||||
if settings["support"]:
|
||||
change_params = "[```json\n{params}\n```]({support})".format(params=json.dumps(change, indent=2), support=settings["support"])
|
||||
if len(change_params) > 1000:
|
||||
embed.add_field(_("Report this on the support server"), settings["support"])
|
||||
else:
|
||||
embed.add_field(_("Report this on the support server"), change_params)
|
||||
embed["author"]["icon_url"] = settings["appearance"]["embed"].get(action, {"icon": None})["icon"]
|
||||
embed["url"] = link
|
||||
if parsed_comment is not None:
|
||||
|
|
|
@ -199,16 +199,10 @@ async def essential_info(change: dict, changed_categories, local_wiki: Wiki, db_
|
|||
identification_string = change["type"]
|
||||
elif change["type"] == "log":
|
||||
identification_string = "{logtype}/{logaction}".format(logtype=change["logtype"], logaction=change["logaction"])
|
||||
if identification_string not in supported_logs:
|
||||
logger.warning(
|
||||
"This event is not implemented in the script. Please make an issue on the tracker attaching the following info: wiki url, time, and this information: {}".format(
|
||||
change))
|
||||
return
|
||||
elif change["type"] == "categorize":
|
||||
return
|
||||
else:
|
||||
logger.warning("This event is not implemented in the script. Please make an issue on the tracker attaching the following info: wiki url, time, and this information: {}".format(change))
|
||||
return
|
||||
identification_string = change["type"]
|
||||
additional_data = {"namespaces": request["query"]["namespaces"], "tags": {}}
|
||||
for tag in request["query"]["tags"]:
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue