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