diff --git a/src/main.py b/src/main.py index ab6dc3d..3752b97 100644 --- a/src/main.py +++ b/src/main.py @@ -123,16 +123,14 @@ async def self(interaction: discord.Interaction, message: str): await interaction.response.send_message(embed=result, ephemeral=False) -try: - character_list = util.create_json_movelists(CHARACTER_LIST_PATH) - scheduler = sched.scheduler(time.time, time.sleep) - # Repeat importing move list of all character from wavu.wiki once an hour - scheduler_thread = threading.Thread(target=util.periodic_function, - args=(scheduler, 3600, util.create_json_movelists, CHARACTER_LIST_PATH)) - scheduler_thread.start() - hei.run(discord_token) +character_list = util.create_json_movelists(CHARACTER_LIST_PATH) +scheduler = sched.scheduler(time.time, time.sleep) + +# Repeat importing move list of all character from wavu.wiki once an hour +scheduler_thread = threading.Thread(target=util.periodic_function, + args=(scheduler, 3600, util.create_json_movelists, CHARACTER_LIST_PATH)) +scheduler_thread.start() +hei.run(discord_token) + -except Exception as e: - 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/embed.py b/src/module/embed.py index fa9c5db..0ea025d 100644 --- a/src/module/embed.py +++ b/src/module/embed.py @@ -60,6 +60,7 @@ def move_embed(character: character, move: dict): colour=SUCCESS_COLOR, description=move['name'], url=f'{character.wavu_page}_movelist#{move["id"].replace(" ", "_")}', + ) embed.set_thumbnail(url=character.portrait[0]) diff --git a/src/module/util.py b/src/module/util.py index b7b6cb0..c5e10b4 100644 --- a/src/module/util.py +++ b/src/module/util.py @@ -22,7 +22,7 @@ def correct_character_name(alias: str): def get_character_by_name(name: str, character_list: []) -> character.Character: for character in character_list: - if character.name == name: + if str(character.name).lower() == name.lower(): return character diff --git a/src/resources/character_list.json b/src/resources/character_list.json index 7400ec2..22d7554 100644 --- a/src/resources/character_list.json +++ b/src/resources/character_list.json @@ -25,7 +25,7 @@ "wavu_page": "https://wavu.wiki/t/Claudio" }, { - "name": "devil_jin", + "name": "devil_Jin", "portrait": "https://i.imgur.com/Y0pez4V.png", "wavu_page": "https://wavu.wiki/t/Devil_Jin" },