为什么我得到这个错误时,在文档中说要使用它?

  • 本文关键字:文档 错误 python discord.py
  • 更新时间 :
  • 英文 :


我遇到的问题是,当我尝试使用命令时,它给了我错误,TypeError: Embed.init()获得了一个意外的关键字参数'value'。它引用了第34行作为问题,有人知道为什么会这样吗?

@client.event
async def on_message(message)
if "!sell" in message.content:
tip = random.randrange(1, 500)
k = f"| {message.author.name} "
val = random.randrange(1000, 5000)
# open entire file for reading and writing
with open("income.json", "r+") as f:
incomes = json.load(f)

# Either add the value to the user's balance
# or, if they don't exist yet, create the entry
# with the val
try:
incomes[k] += val + tip
except KeyError:
incomes[k] = val + tip
# seek to beginning and rewrite file
f.seek(0)
json.dump(incomes, f, indent=4)
embedVar = discord.Embed(title=(message.author.name) + " Distributed", value=None, inline=False, color=0xfc3503)
embedVar.add_field(name=('﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'), value=(("You were tipped ")+(str(tip))+(" by the buyer")), inline=False)
embedVar.add_field(name=('﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'), value=(f"You Earned {val} Dollars from distributing"))

我已经尝试将关键字值更改为其他的,如描述,也尝试将值更改为= none,但这些都不起作用。

官方文档没有将value作为有效参数

https://discordpy.readthedocs.io/en/stable/api.html嵌入

class discord.Embed(*, colour=None, color=None, title=None, type='rich', url=None, description=None, timestamp=None)

您可能正在某处阅读过时的文档。

最新更新