Merged Kanji Search

This commit is contained in:
Robert 2020-08-11 18:34:09 +02:00
parent f67d8d0106
commit 9fb16ef8d3

View file

@ -27,6 +27,13 @@ class Kanji(commands.Cog):
self.latestMessage = 0 self.latestMessage = 0
async def createEmbed(self): async def createEmbed(self):
if self.activeObject.total_pages == 0:
embed = discord.Embed(
title = "No search results",
description = "The search returned nothing. Did you make a typo?",
colour = 0x56d926
)
else:
response = self.activeObject.response response = self.activeObject.response
node = response.nodes[self.activeObject.page] node = response.nodes[self.activeObject.page]