M
M
menma_uzumakie2022-04-05 20:06:31
PHP
menma_uzumakie, 2022-04-05 20:06:31

Why doesn't the bot send a picture?

624c77160b980215076754.pngCommand 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

2 answer(s)
L
Lander, 2016-08-21
@NI

Check that both $x = 1 and $x * $y are English characters. Most likely there is Cyrillic somewhere.

S
s4q, 2022-04-05
@menma_uzumakie

http://api.nekos.fun:8080/api/kissreturns

{"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 question

Ask a Question

731 491 924 answers to any question