Fixed api interface
This commit is contained in:
parent
e2b42cbabc
commit
88d7ea0ac4
2 changed files with 21 additions and 10 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue