我的命令似乎对命令没有响应。另外,我是否使用十六进制值或其他值?
@commands.command()
async def rolecreate(self, ctx, rolename, rolecolour):
guild = ctx.guild
await guild.create_role(name=f"{rolename}", colour=discord.Colour(rolecolour))
await ctx.send(f"{rolename} role with the colour {rolecolour} has been created")```发布于 2020-09-13 20:04:26
您需要一个int,但您正在传递一个str,请在rolecolour参数中指定Colour类:
@commands.command()
async def rolecreate(self, ctx, rolecolour: discord.Colour, *, rolename):
guild = ctx.guild
await guild.create_role(name=f"{rolename}", colour=rolecolour)
await ctx.send(f"{rolename} role with the colour {rolecolour} has been created")https://stackoverflow.com/questions/63870286
复制相似问题