我正在尝试发出命令,以便当有人制作#color [color_here]
(#color ff00ff
时会以该颜色的嵌入和该颜色的图像作为响应
到目前为止,我没有可用的代码:
@bot.command(pass_context=True)
async def color(ctx, arg):
author = ctx.message.author
color = discord.Colour(0x + arg)
embed=discord.Embed(name="COLOR", color=color)
embed.set_author(name="Color Testing", icon_url='https://cdn.discordapp.com/avatars/464392471913168927/2e4866f48526dba93253b57326104a1b.png?size=2048')
embed.add_field(name="**Color**:", value=color, inline=False)
embed.set_footer(text="Requested by {}".format(author), icon_url=author.avatar_url)
await bot.say(embed=embed)
答案 0 :(得分:0)
尝试改用color = discord.Colour(int(f'0x{arg}', 16))