Discord.py 嵌入未发送

Discord.py embed not getting sent

我刚刚用 discord.py 编写了一个机器人,但我的帮助命令似乎有问题,因为出于某种原因,我希望发送的嵌入没有显示。

这是我的帮助命令代码:

@client.command(aliases=["h"])
async def bothelp(ctx):
   await ctx.send("help command coming soon!")
   embed = discord.Embed(title = "Help for the bot", description = "", color = discord.Colour.purple())
   embed.add_field(name = "Command List", value = "", inline = False)
   embed.add_field(name = "#hello", value = "Replies with a greeting. \nAliases: hey, hi", inline = True)
   embed.add_field(name = "#whois <mention>", value = "Gives the user info of the member mentioned. \nAliases: user, info", inline = True)
   embed.add_field(name = "#clear (number)", value = "Clears the number of messages given by the user. If number is not entered, deletes the most recent message. \nAliases = c \nPermissions = Manage Messages", inline = True)
   embed.add_field(name = "#kick (mention)", value = "Kicks the member mentioned. \nAliases: k \n Permissions: Kick Members", inline = True)
   embed.add_field(name = "#ban (mention)", value = "Bans the member mentioned. \nAliases: b \n Permissions: Ban Members", inline = True)
   embed.add_field(name = "#unban (username with tag)", value = "Unbans the member specified. \nAliases: ub \n Permissions: Ban Members", inline = True)
   embed.set_footer(icon_url = ctx.author.avatar_url, text = f"Requested by {ctx.author.name}")
   await ctx.send(embed=embed)

但是,嵌入没有发布。我试图找到错误,但我找不到。有人可以帮我吗?

谢谢!

字段值不能是None或空字符串,您的第一个字段没有值。给它增加一些价值

修改后的代码如下:

@client.command(aliases=["h"])
async def bothelp(ctx):
   await ctx.send("help command coming soon!")
   embed = discord.Embed(title = "Help for the bot", description = "", color = discord.Colour.purple())
   embed.add_field(name = "Command List", value = "Here are all commands", inline = False)
   embed.add_field(name = "#hello", value = "Replies with a greeting. \nAliases: hey, hi", inline = True)
   embed.add_field(name = "#whois <mention>", value = "Gives the user info of the member mentioned. \nAliases: user, info", inline = True)
   embed.add_field(name = "#clear (number)", value = "Clears the number of messages given by the user. If number is not entered, deletes the most recent message. \nAliases = c \nPermissions = Manage Messages", inline = True)
   embed.add_field(name = "#kick (mention)", value = "Kicks the member mentioned. \nAliases: k \n Permissions: Kick Members", inline = True)
   embed.add_field(name = "#ban (mention)", value = "Bans the member mentioned. \nAliases: b \n Permissions: Ban Members", inline = True)
   embed.add_field(name = "#unban (username with tag)", value = "Unbans the member specified. \nAliases: ub \n Permissions: Ban Members", inline = True)
   embed.set_footer(icon_url = ctx.author.avatar_url, text = f"Requested by {ctx.author.name}")
   await ctx.send(embed=embed)