Skip to content

Commit

Permalink
Merge pull request #10 from AbhijeetKrishnan/dev
Browse files Browse the repository at this point in the history
Fix issue with multi-word char names like Devil Jin
  • Loading branch information
TLNBS2405 authored Feb 15, 2024
2 parents abac24d + 9ce5758 commit 1535a21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
7 changes: 3 additions & 4 deletions src/module/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
10 changes: 1 addition & 9 deletions src/wavu/wavu_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,14 @@
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",
"tables": "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",
Expand Down

0 comments on commit 1535a21

Please sign in to comment.