Skip to content

Commit

Permalink
Update vocadb.py (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
DJTOMATO committed Apr 18, 2024
1 parent bb1817f commit aff49ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vocadb/vocadb.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _lyrics_embed(colour, page: Dict[str, Any], data: Dict[str, Any]) -> discord
title = [
x.get("value")
for x in data.get("names")
if x.get("language") == LANGUAGE_MAP.get(page["cultureCode"])
if x.get("language") == LANGUAGE_MAP.get(page.get("translationType"))
]
em = discord.Embed(
title=title[0] if title else data.get("defaultName"),
Expand All @@ -156,7 +156,7 @@ def _lyrics_embed(colour, page: Dict[str, Any], data: Dict[str, Any]) -> discord
@commands.cooldown(1, 5, commands.BucketType.user)
async def vocadb(self, ctx: commands.Context, *, query: str):
"""Fetch Vocaloid song lyrics from VocaDB.net database"""
await ctx.trigger_typing()
await ctx.typing()
data = await self._fetch_data(ctx, query)

if type(data) == str:
Expand All @@ -170,7 +170,7 @@ async def vocadb(self, ctx: commands.Context, *, query: str):

embeds = []
for i, page in enumerate(data["lyrics"], start=1):
language = f"Language: {LANGUAGE_MAP.get(page.get('cultureCode', 'na'))}"
language = f"Version: {page.get('translationType', 'na')}"
emb = self._lyrics_embed(await ctx.embed_colour(), page, data)
emb.set_footer(text=f"{language} • Page {i} of {len(data['lyrics'])}")
embeds.append(emb)
Expand Down

0 comments on commit aff49ea

Please sign in to comment.