diff --git a/cogs/search.py b/cogs/search.py index a1bc958..a55c1eb 100644 --- a/cogs/search.py +++ b/cogs/search.py @@ -91,7 +91,7 @@ class Search(commands.Cog): @commands.command(name="search", description="Searches Jisho", usage="", aliases=["s"]) @commands.cooldown(1, 5) async def search(self, ctx: commands.Context, *, query: str = None): - if query == None: + if query is None: return self.activeObject = JishoObject(query, ctx.author.id) diff --git a/utils/jisho.py b/utils/jisho.py index f42a608..ccf2ec6 100644 --- a/utils/jisho.py +++ b/utils/jisho.py @@ -134,14 +134,14 @@ class JishoKanji(): # Kun Yomi kun_block = readings_block.findChild("dl", {"class": "dictionary_entry kun_yomi"}, recursive=True) - if kun_block != None: + if kun_block is not None: readings = kun_block.findChildren("a", recursive=True) for reading in readings: self.nodes[-1].kun.append(reading.string) # On Yomi on_block = readings_block.findChild("dl", {"class": "dictionary_entry on_yomi"}, recursive=True) - if on_block != None: + if on_block is not None: readings = on_block.findChildren("a", recursive=True) for reading in readings: self.nodes[-1].on.append(reading.string) @@ -153,7 +153,7 @@ class JishoKanji(): # JLPT/Grade info grade_block = info.findChild("div", {"class": "grade"}, recursive=True) - if grade_block != None: + if grade_block is not None: self.nodes[-1].grade = grade_block.findChild("strong").string[-1] self.nodes[-1].jlpt = info.findChild("div", {"class": "jlpt"}, recursive=True).findChild("strong").string @@ -171,5 +171,3 @@ class JishoKanji(): image_url = "https:" + image_url image_url = image_url.replace("shotai3", "shotai2") self.nodes[-1].image_url = image_url - -