Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x Discord.py按名称查找成员并将成员移动到语音频道_Python 3.x_Discord.py Rewrite - Fatal编程技术网

Python 3.x Discord.py按名称查找成员并将成员移动到语音频道

Python 3.x Discord.py按名称查找成员并将成员移动到语音频道,python-3.x,discord.py-rewrite,Python 3.x,Discord.py Rewrite,我正在尝试创建一个命令!移动用户名,将指定用户移动到特定的语音频道。 我无法让它工作,我也不确定为什么,因为我没有收到任何错误消息 代码: 为什么这不起作用?能否为传递给move函数的两个参数添加一个print(),以便我可以看到输出?你在用什么图书馆?这可能是因为arg是一个列表或字典,而不是字符串。第5行必须是member=ctx.guild.get\u member\u named(arg),然后它就可以工作了。 @bot.command(name='move', pass_contex

我正在尝试创建一个命令
!移动用户名
,将指定用户移动到特定的语音频道。
我无法让它工作,我也不确定为什么,因为我没有收到任何错误消息

代码:


为什么这不起作用?

能否为传递给move函数的两个参数添加一个print(),以便我可以看到输出?你在用什么图书馆?这可能是因为arg是一个列表或字典,而不是字符串。第5行必须是
member=ctx.guild.get\u member\u named(arg)
,然后它就可以工作了。
@bot.command(name='move', pass_context=True)
@has_permissions(kick_members=True)
async def move(ctx, arg):
    channel = bot.get_channel(00000000000000000)
    member = Guild.get_member_named(arg)
    await member.move_to(channel)