diff --git a/src/main.py b/src/main.py index c443a30..536b5ae 100644 --- a/src/main.py +++ b/src/main.py @@ -342,5 +342,5 @@ async def self(interaction: discord.Interaction, message: str): hei.run(discord_token) except Exception as e: - time_now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + time_now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") logger.error(f'{time_now} \n Error: {e}') diff --git a/src/module/util.py b/src/module/util.py index 37f9823..2861c01 100644 --- a/src/module/util.py +++ b/src/module/util.py @@ -56,7 +56,7 @@ def create_json_movelists(character_list_path: str) -> List[character.Character] cha = wavu_importer.import_character(character_meta) cha.export_movelist_as_json() cha_list.append(cha) - time_now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + time_now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") print(f'{time_now} - Character jsons are successfully created') return cha_list diff --git a/src/resources/character_list.json b/src/resources/character_list.json index 2406fef..bbe5d60 100644 --- a/src/resources/character_list.json +++ b/src/resources/character_list.json @@ -147,7 +147,7 @@ { "name": "xiaoyu", "portrait": "https://i.imgur.com/tnZ4qby.png", - "wavu_page": "https://wavu.wiki/t/Yoshimitsu" + "wavu_page": "https://wavu.wiki/t/Xiaoyu" }, { "name": "yoshimitsu", diff --git a/src/wavu/wavu_reader.py b/src/wavu/wavu_reader.py index 7c7dcad..cdab1e3 100644 --- a/src/wavu/wavu_reader.py +++ b/src/wavu/wavu_reader.py @@ -119,7 +119,7 @@ def _convert_json_movelist(move_list_json: list) -> List[Move]: if move["title"]["ns"] == "0": alias = [] id = _normalize_data(move["title"]["id"]) - name = _normalize_data(move["title"]["name"]) + name = _normalize_data(_process_links(move["title"]["name"])) input = _normalize_data( _get_all_parent_values_of("input", _normalize_data(move["title"]["parent"]), move_list_json) + _normalize_data(move["title"]["input"])) @@ -158,10 +158,14 @@ def _remove_html_tags(data): result = result.replace("'''", "") return result + link_replace_pattern = re.compile(r'\[\[(?P[^#]+)#(?P
[^|]+)\|(?P[^|]+)\]\]') + + def _process_links(data: str | None) -> str: def _replace_link(match): page, section, data = match.group('page'), match.group('section'), match.group('data') hover_text = 'Combo' if section == 'Staples' else 'Mini-combo' return f"[{data}](https://wavu.wiki/t/{page.replace(' ', '_')}#{section} \'{hover_text}\')" + return link_replace_pattern.sub(_replace_link, _empty_value_if_none(data))