Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
TLNBS2405 authored Feb 15, 2024
2 parents f8e3132 + abac24d commit 9ce5758
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
20 changes: 9 additions & 11 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
1 change: 1 addition & 0 deletions src/module/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion src/module/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion src/resources/character_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit 9ce5758

Please sign in to comment.