Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.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 命令引发异常:HTTPException:400错误请求(错误代码:50007):无法向此用户发送消息_Python 3.x_Http_Discord.py - Fatal编程技术网

Python 3.x 命令引发异常:HTTPException:400错误请求(错误代码:50007):无法向此用户发送消息

Python 3.x 命令引发异常:HTTPException:400错误请求(错误代码:50007):无法向此用户发送消息,python-3.x,http,discord.py,Python 3.x,Http,Discord.py,我正在创建discord bot,但找不到此错误: 命令引发异常:HTTPException:400错误请求(错误代码:50007):无法向此用户发送消息 我试过了,但没有成功: if not isinstance(error, discord.HTTPException): await member.send(f"vous avez été bannis de {ctx.guild.name}") await member.ban(reason=arg)

我正在创建discord bot,但找不到此错误:

命令引发异常:HTTPException:400错误请求(错误代码:50007):无法向此用户发送消息

我试过了,但没有成功:

if not isinstance(error, discord.HTTPException):
    await member.send(f"vous avez été bannis de {ctx.guild.name}")
    await member.ban(reason=arg)

你能帮我吗?plz

一些用户禁用非好友消息,因此你只需跳过该用户或使用

试试看:
等待会员。发送(f“vous avezétébannis de{ctx.guild.name}”)
除:
通过