diff --git a/cogs/kanji.py b/cogs/kanji.py index 4017b26..32f62aa 100644 --- a/cogs/kanji.py +++ b/cogs/kanji.py @@ -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}") diff --git a/utils/jisho.py b/utils/jisho.py index f9f618e..c72acc4 100644 --- a/utils/jisho.py +++ b/utils/jisho.py @@ -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: