diff --git a/src/formatters/rc.py b/src/formatters/rc.py index ea1c531..e576572 100644 --- a/src/formatters/rc.py +++ b/src/formatters/rc.py @@ -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"]: - embed.add_field(_("Report this on the support server"), 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: diff --git a/src/wiki.py b/src/wiki.py index 86ed364..12a30ee 100644 --- a/src/wiki.py +++ b/src/wiki.py @@ -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: