Discord.py 重写 <discord.embeds.Embed object at 0x108778288>
Discord.py Rewrite <discord.embeds.Embed object at 0x108778288>
我在一年后重新访问 discord.py,发现异步显然不可用,现在我正在使用重写,但不知道我在做什么。我正在尝试发送一个简单的嵌入,但机器人却这样说:
'<discord.embeds.Embed object at 0x108778288>'
这是我的代码:
@bot.command(pass_context=True)
async def help(ctx):
aiuto = discord.Embed(title="Help", description="being helpful")
await ctx.send(aiuto)
答案吧:
等待 ctx.send(embed=aiuto)
您现在可以将 embed
kwarg 传递给消息,
await ctx.send(embed = aiuto)
此外,在 discord.py 重写中,您不需要将 pass_context
传递给 bot.command
,
@bot.command
也有效
我在一年后重新访问 discord.py,发现异步显然不可用,现在我正在使用重写,但不知道我在做什么。我正在尝试发送一个简单的嵌入,但机器人却这样说:
'<discord.embeds.Embed object at 0x108778288>'
这是我的代码:
@bot.command(pass_context=True)
async def help(ctx):
aiuto = discord.Embed(title="Help", description="being helpful")
await ctx.send(aiuto)
答案吧: 等待 ctx.send(embed=aiuto)
您现在可以将 embed
kwarg 传递给消息,
await ctx.send(embed = aiuto)
此外,在 discord.py 重写中,您不需要将 pass_context
传递给 bot.command
,
@bot.command
也有效