我正在尝试使用户静音。
@client.command()
@commands.has_permissions(administrator=True)
async def mute(ctx, user: discord.Member, *, reason=None):
await user.mute(reason=reason)
await ctx.send(f'{user} has been muted')
我收到以下错误:
Member object has no attribute "mute"
如何使用户静音?
答案 0 :(得分:0)
尝试一下:
@client.command()
@commands.has_permissions(administrator=True)
async def mute(ctx, user : discord.Member, *, reason = None):
await user.edit(mute = True, reason = reason)
await ctx.send(f'{user} has been muted')