diff --git a/src/module/embed.py b/src/module/embed.py index f52602f..0ea025d 100644 --- a/src/module/embed.py +++ b/src/module/embed.py @@ -56,17 +56,16 @@ def success_embed(message): def move_embed(character: character, move: dict): """Returns the embed message for character and move""" - move_id = move["id"].replace(" ","_") - url= f'{character.wavu_page}_movelist#{move_id}' embed = discord.Embed(title='**' + move['input'] + '**', colour=SUCCESS_COLOR, description=move['name'], - url=url, + url=f'{character.wavu_page}_movelist#{move["id"].replace(" ", "_")}', + ) embed.set_thumbnail(url=character.portrait[0]) embed.set_footer(text="Wavu.wiki", icon_url=WAVU_LOGO) - embed.set_author(name=_upper_first_letter(character.name), url=character.wavu_page) + embed.set_author(name=_upper_first_letter(character.name.replace('_', ' ').title()), url=character.wavu_page) embed.add_field(name='Target', value=move['target']) embed.add_field(name='Damage', value=move['damage']) diff --git a/src/wavu/wavu_reader.py b/src/wavu/wavu_reader.py index 8d3d14b..95f6838 100644 --- a/src/wavu/wavu_reader.py +++ b/src/wavu/wavu_reader.py @@ -10,14 +10,6 @@ session = requests.Session() -def _upper_first_letter(input: str) -> str: - if input: - result_string = input[0].capitalize() + input[1:] - return result_string - else: - return input - - def get_wavu_character_movelist(character_name: str) -> List[Move]: params = { "action": "cargoquery", @@ -25,7 +17,7 @@ def get_wavu_character_movelist(character_name: str) -> List[Move]: "fields": "id,name,input,parent,target,damage,startup, recv, tot, crush, block,hit,ch,notes,_pageNamespace=ns", "join_on": "", "group_by": "", - "where": "id LIKE '" + _upper_first_letter(character_name) + "%'", + "where": "id LIKE '" + character_name.replace('_', ' ').title() + "%'", "having": "", "order_by": "id", "offset": "0",