【发布时间】:2021-10-09 01:54:53
【问题描述】:
所以这个命令的全部工作,但我不断收到一条错误消息:
NotFound: 404 Not Found (error code: 10011): Unknown Role.
我尝试使用从角色 id 到 discord.guild.get_role 的很多东西,但我一直收到同样的错误。任何帮助表示赞赏!
@bot.command(pass_context = True)
async def mute(ctx, member: discord.Member):
if ctx.message.author.guild_permissions.administrator:
role = discord.utils.get(ctx.guild.roles, name="Muted")
await member.add_roles(member, role)
embed=discord.Embed(title="User Muted!", description="**{0}** was muted by **{1}**!".format(member, ctx.message.author), color=0xff00f6)
await bot.say(embed=embed)
else:
embed=discord.Embed(title="Permission Denied.", description="You don't have permission to use this command.", color=0xff00f6)
await bot.say(embed=embed)
【问题讨论】:
标签: python discord discord.py