python - Discord.py 取消静音错误:“协程”对象不可调用
问题描述
我一直在为我的 discord.py 机器人编写取消静音功能。完成后,我尝试运行它,并弹出此错误:'coroutine' object is not callable
这是我的代码顺便说一句:
@bot.command(description="Unmutes a specified user.")
@commands(manage_messages=True)
async def unmute(ctx, member: discord.Member):
mutedRole = discord.utils.get(ctx.guild.roles, name="Muted")
await member.remove_roles(mutedRole)
await member.send(f" you have unmutedd from: - {ctx.guild.name}")
embed = discord.Embed(title="unmute", description=f" unmuted-{member.mention}",colour=discord.Colour.green())
await ctx.send(embed=embed)
我该怎么办?
解决方案
装饰器@commands(manage_messages=True)
不存在。
我假设你的意思是@commands.has_permissions(manage_messages=True)
. 那应该工作
推荐阅读
- ffmpeg - 从 ffmpeg 流式传输到 Youtube 时没有音频
- ios - 驱动器只能从 MainThread 调用
- php - 当用户按下返回按钮(注册后)导航到上一页时刷新原始页面
- antlr - 当我收到“输入时没有可行的替代方案”错误时,如何调试 Antlr 语法?
- amazon-web-services - 将无服务器应用程序部署到 docker
- javascript - 切换到日期选择器并单击下个月
- excel - 查找多列的匹配单元格值并发送有关匹配信息的邮件
- internet-explorer - 有没有更优雅的方式来使用 AutoIt 获取 Internet Explorer 版本
- shopify - 当 URL 中存在 Shopify 转换跟踪变量时如何运行代码?
- javascript - 选择选项值添加到查询字符串