Answer the question
In order to leave comments, you need to log in
Why doesn't the bot send a picture?
Command not working
@bot.command()
async def neko(ctx):
response = requests.get(' http://api.nekos.fun:8080/api/kiss') # Get-запрос
json_data = json.loads(response.text) # Извлекаем JSON
embed = discord.Embed(color = 0xff9900, title = 'Кишка') # Создание Embed'a
embed.set_image(url = json_data['link']) # Устанавливаем картинку Embed'a
await ctx.send(embed = embed) # Отправляем Embed
Answer the question
In order to leave comments, you need to log in
Check that both $x = 1 and $x * $y are English characters. Most likely there is Cyrillic somewhere.
http://api.nekos.fun:8080/api/kiss
returns
{"image": "https://nekos.fun/storage/kiss/kiss_131.gif"}
and you are trying to get a linklink
@bot.command()
async def neko(ctx):
response = requests.get('http://api.nekos.fun:8080/api/kiss').json()
embed = discord.Embed(color = 0xff9900, title = 'Кишка')
embed.set_image(url = response['image'])
await ctx.send(embed = embed)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question