Fixed api interface

This commit is contained in:
Robert 2020-08-11 12:09:59 +02:00
parent e2b42cbabc
commit 88d7ea0ac4
2 changed files with 21 additions and 10 deletions

View file

@ -12,14 +12,15 @@ class Search(commands.Cog):
if query == None:
return
response = jisho.query(query)
await ctx.send(response["data"][0]["slug"])
response = jisho.JishoResponse(query)
await ctx.send(response.nodes[0].slug)
@search.error
async def search_error(self, ctx, error):
if isinstance(error, commands.CommandOnCooldown):
pass # Suppress that annoying exception everytime someone is on cooldown
return # Suppress that annoying exception everytime someone is on cooldown
raise error
def setup(bot: commands.Bot):