【发布时间】:2021-05-05 11:44:56
【问题描述】:
我正在尝试创建一个命令,通过在消息中键入它来创建一个具有其颜色的角色,但是我不断收到此错误
discord.ext.commands.errors.CommandInvokeError:命令引发异常:TypeError:role() 缺少 1 个必需的仅关键字参数:'color'
@commands.command(aliases=['make_role'])
@commands.has_permissions(manage_roles=True)
async def role(self, ctx, *, name,color):
guild=ctx.guild
await guild.create_role(name=name, color=colors)
await ctx.send(f'Role `{name}` has been created, color is {colors}')
【问题讨论】:
标签: discord discord.py discord.py-rewrite