Discord 不协调bot设置嵌入消息颜色

Discord 不协调bot设置嵌入消息颜色,discord,discord.py,embed,discord.py-rewrite,Discord,Discord.py,Embed,Discord.py Rewrite,所以我制作了这个代码来发送嵌入消息,如果你写000000它会使嵌入变为黑色,但是如果你写ff0000为红色,它不会工作,你必须写0xff0000才能工作,有没有办法让ff0000在没有0x的情况下工作?这是我的密码: async def embed(ctx, *, content: str): title, description, color = content.split('|') embed = discord.Embed(title=title, description=

所以我制作了这个代码来发送嵌入消息,如果你写
000000
它会使嵌入变为黑色,但是如果你写
ff0000
为红色,它不会工作,你必须写
0xff0000
才能工作,有没有办法让
ff0000
在没有
0x
的情况下工作?这是我的密码:

async def embed(ctx, *, content: str):
    title, description, color = content.split('|')
    embed = discord.Embed(title=title, description=description, color=int(color, 0))
    await ctx.send(embed=embed)

任何帮助都将不胜感激。

您只需将颜色(
ff0000
)转换为基数为16的整数即可

异步定义嵌入(ctx,*,内容:str): 标题、说明、颜色=内容。拆分(“|”) 嵌入=不和谐。嵌入(标题=标题,描述=描述,颜色=整数(颜色,16)) 您可以使用链接选择您的颜色(复制十进制颜色)。在嵌入中,只需添加
color=(小数位数)