D
D
Deranik2020-07-06 00:25:08
Python
Deranik, 2020-07-06 00:25:08

Where is the error in the code (Bot Discord)?

@bot.command(pass_context=True)

@bot.command
async def say(ctx, a1, a2, a3, a4):

    embed = discord.Embed(title=a1, description = a2, colour=0x4169E1)
    emded.set_footer(description = a3)
    embed.set_image(url=a4)
    await ctx.message.delete()
    await ctx.send(embed=embed)


Console:
Traceback (most recent call last):
  File "bot.py", line 11, in <module>
    async def say(ctx, a1, a2, a3, a4):
  File "C:\Python38\lib\site-packages\discord\ext\commands\core.py", line 1162, in decorator
    result = command(*args, **kwargs)(func)
  File "C:\Python38\lib\site-packages\discord\ext\commands\core.py", line 1317, in decorator
    return cls(func, name=name, **attrs)
  File "C:\Python38\lib\site-packages\discord\ext\commands\core.py", line 210, in __init__
    raise TypeError('Callback must be a coroutine.')
TypeError: Callback must be a coroutine.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Tikhonov, 2020-07-06
@tumbler

You are using the bot.command decorator twice.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question