不和谐嵌入错误

时间:2020-05-21 22:59:03

标签: python discord discord.py

我有这个非常基本的嵌入代码,但是由于某些原因它无法正常工作。

@bot.command()
async def SellEmbed(ctx):
    embed = discord.Embed(title="Buy Roles", description="Role 1", color=0x00e9ff)
    embed.add_field(name="", value="Role 2", inline=True)
    embed.add_field(name=" ", value="Role 3", inline=False)
    embed.add_field(name=" ", value="Role 4", inline=False)

await bot.say(embed=embed)

我一直遇到的错误是。 忽略命令SellEmbed中的异常:


Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-

packages/discord/ext/commands/core.py", line 83, in wrapped
    ret = await coro(*args, **kwargs)

File "/Users/emil/Desktop/Ghost Bot/Ghost-bot.py", line 24, in SellEmbed
    await bot.say(embed=embed)

AttributeError: 'Bot' object has no attribute 'say'

上述异常是以下异常的直接原因:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 892, in invoke
    await ctx.command.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/ext/commands/core.py", line 797, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/ext/commands/core.py", line 92, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'say'

如果您知道我做错了,请告诉我!

0 个答案:

没有答案