as per the error you got:
Please defer it using "interaction.response.defer" on the start of your command
@bot.slash_command(description="Get a random dog picture")
async def dog(inter):
await inter.response.defer()
async with aiohttp.ClientSession() as session:
request = await session.get('https://some-random-api.ml/animal/dog')
dog = await request.json()
embed = disnake.Embed(title="Random Dog Picture",description=dog['fact'])
embed.set_image(url=dog['image'])
await inter.send(embed=embed)
Later you may send a response by editing the deferred message using "interaction.edit_original_response"
This is because you can only respond (inter.response.<...>) once to an interaction. inter.response.defer() creates a temporary "<bot> is thinking..." message, which we can then edit into whatever you want it to be:
@bot.slash_command(description="Get a random dog picture")
async def dog(inter):
await inter.response.defer()
async with aiohttp.ClientSession() as session:
request = await session.get('https://some-random-api.ml/animal/dog')
dog = await request.json()
embed = disnake.Embed(title="Random Dog Picture",description=dog['fact'])
embed.set_image(url=dog['image'])
await inter.edit_original_message(embed=embed)