B
B
berafr12032021-12-16 14:42:34
Python
berafr1203, 2021-12-16 14:42:34

Why is discord.py complaining that the int attribute is missing?

The code runs smoothly, but when I enter the command, it gives an error in the console:

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'int' object has no attribute 'set_image'

The code:
@client.command(aliases = ['fox'])
async def embed(ctx):
    response = requests.get('https://some-random-api.ml/img/fox')
    json_data = json.loads(response.text)
    embed = discord.Embed(
        title='тест', description='***???***', color=0xff9900, set_image(json_data['link'])
    )
    await ctx.send(embed=embed)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Shvedov, 2021-12-16
@mmmaaak

Dot instead of comma after color attribute

A
AlmondPark33609, 2021-12-21
@AlmondPark33609

It is necessary to write instead of the set_image attribute embed.set_image

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question