【发布时间】:2021-07-12 06:03:43
【问题描述】:
我正在制作一个不和谐的机器人,它有一个移动命令,可以将一个语音通道中的所有成员移动到另一个,主要问题是这个命令应该只适用于那些拥有移动成员权限的人,但它不起作用!即使用户拥有该权限,它也不起作用并且它总是向我显示错误。代码如下:
def in_voice_channel():
def predicate(ctx):
return ctx.author.voice and ctx.author.voice.channel
return check(predicate)
@in_voice_channel()
@client.command()
@commands.has_permissions(move_members=True)
async def moveall(ctx, *, channel : discord.VoiceChannel):
author_ch = ctx.author.voice.channel.mention
for members in ctx.author.voice.channel.members:
await members.move_to(channel)
await ctx.send(f'Moved everyone in {author_ch} to {channel.mention}!')
【问题讨论】:
-
显示什么错误?
-
抱歉回复晚了
You are missing Move Members permission(s) to run this command.
标签: python discord.py