Skip to content

Commit

Permalink
Add video link if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
TLNBS2405 committed Mar 23, 2024
1 parent 089dcce commit 657afdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/frame_service/wavu/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from framedb.const import CharacterName

WAVU_API_URL = "https://wavu.wiki/w/api.php"
WAVU_VIDEO_LINK = "https://wavu.wiki/t/"

"""Available fields for the Move table in the Wavu DB"""
FIELDS = [
Expand Down Expand Up @@ -130,8 +131,9 @@ def _convert_json_move(move_json: Any) -> WavuMove:
else:
image = ""

if "video" in move_json:
if "video" in move_json and move_json["video"]:
video = _process_links(move_json["video"])
video = WAVU_VIDEO_LINK + video
else:
video = ""

Expand Down
3 changes: 3 additions & 0 deletions src/heihachi/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def get_move_embed(frame_service: FrameService, character: Character, move: Move
if move.image:
embed.set_image(url=move.image)

if move.video:
embed.add_field(name="Video", value=move.video, inline=False)

# TODO: include move.video in a nice way

return embed
Expand Down

0 comments on commit 657afdb

Please sign in to comment.