Added meanings
This commit is contained in:
parent
b333bbad41
commit
1d1b66f87a
|
@ -32,13 +32,14 @@ class Kanji(commands.Cog):
|
|||
embed = discord.Embed(
|
||||
title = node.kanji,
|
||||
url = node.url,
|
||||
description = node.meaning,
|
||||
colour = 0x56d926
|
||||
)
|
||||
|
||||
if node.kun:
|
||||
embed.add_field(name="Kun", value=", ".join(node.kun))
|
||||
embed.add_field(name="Kun", value=", ".join(node.kun), inline=False)
|
||||
if node.on:
|
||||
embed.add_field(name="On", value=", ".join(node.on))
|
||||
embed.add_field(name="On", value=", ".join(node.on), inline=False)
|
||||
|
||||
embed.set_footer(text=f"{self.activeObject.page + 1}/{self.activeObject.total_pages}")
|
||||
|
||||
|
|
|
@ -87,6 +87,7 @@ class JishoKanjiNode():
|
|||
# Information about the Kanji
|
||||
self.kanji = ""
|
||||
self.url = "https://jisho.org/search/"
|
||||
self.meaning = ""
|
||||
self.kun = []
|
||||
self.on = []
|
||||
|
||||
|
@ -119,8 +120,11 @@ class JishoKanji():
|
|||
self.nodes[-1].kanji = info.findChild("h1").string
|
||||
self.nodes[-1].url += urllib.parse.quote_plus(self.nodes[-1].kanji + "#kanji")
|
||||
|
||||
# Meanings
|
||||
self.nodes[-1].meaning = info.findChild("div", {"class": "kanji-details__main-meanings"}, recursive=True).string
|
||||
|
||||
readings_block = info.findChild("div", {"class": "kanji-details__main-readings"}, recursive=True)
|
||||
|
||||
|
||||
# Kun Yomi
|
||||
kun_block = readings_block.findChild("dl", {"class": "dictionary_entry kun_yomi"}, recursive=True)
|
||||
if kun_block != None:
|
||||
|
|
Loading…
Reference in a new issue