如何让嵌入与discord.py一起工作?

如何让嵌入与discord.py一起工作?,discord.py,Discord.py,所以我正在为我的机器人做一个测试命令,嵌入对我来说不起作用这是我的代码,我试着查找它,但在我的旧机器人中,我让它起作用,但没有cogs import discord from discord.ext import commands class TestCog(commands.Cog, name="test command"): def __init__(self, bot): self.bot = bot @comman

所以我正在为我的机器人做一个测试命令,嵌入对我来说不起作用这是我的代码,我试着查找它,但在我的旧机器人中,我让它起作用,但没有cogs

import discord
from discord.ext import commands


class TestCog(commands.Cog, name="test command"):
    def __init__(self, bot):
        self.bot = bot
        
    @commands.command(name = "test",
                    usage="",
                    description = "Testtttttt.")
    @commands.cooldown(1, 2, commands.BucketType.member)
    async def test(self, ctx):
      embed=discord.Embed(title="Ping")
      embed.add_field(name="Pong", value="undefined", inline=False)
            await ctx.send(embed=embed) 

def setup(bot):
    bot.add_cog(TestCog(bot))

您需要在嵌入中指定一个
说明
——如果您不希望它包含任何值,那么您可以简单地将其赋值为
“”

导入不一致
从discord.ext导入命令
类TestCog(commands.Cog,name=“test command”):
def uuu init uuuu(自我,机器人):
self.bot=bot
@commands.command(name=“test”,
用法=”,
description=“testtttt.”
@commands.cooldown(1,2,commands.BucketType.member)
异步def测试(自身、ctx):
嵌入=不协调。嵌入(title=“Ping”,description=”“)
嵌入.add_字段(name=“Pong”,value=“undefined”,inline=False)
等待ctx.send(嵌入=嵌入)
def设置(机器人):
bot.add_cog(TestCog(bot))