Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/347.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 discord.ext.commands.errors.CommandInvokeError:命令引发异常:AttributeError:“非类型”对象没有属性“提及”_Python_Discord_Discord.py - Fatal编程技术网

Python discord.ext.commands.errors.CommandInvokeError:命令引发异常:AttributeError:“非类型”对象没有属性“提及”

Python discord.ext.commands.errors.CommandInvokeError:命令引发异常:AttributeError:“非类型”对象没有属性“提及”,python,discord,discord.py,Python,Discord,Discord.py,我的代码: @commands.commandpass_context=True @仅限commands.guild\u 异步def所有者自身,ctx: 等待ctx.sendctx.guild.owner.notice 错误: discord.ext.commands.errors.CommandInvokeError:命令引发了错误 异常:AttributeError:“非类型”对象没有属性 “提到” 在discord.py1.5.x的新版本中,在意图上有一些变化。意图就像权限。您需要定义它,

我的代码:

@commands.commandpass_context=True @仅限commands.guild\u 异步def所有者自身,ctx: 等待ctx.sendctx.guild.owner.notice 错误:

discord.ext.commands.errors.CommandInvokeError:命令引发了错误 异常:AttributeError:“非类型”对象没有属性 “提到”


在discord.py1.5.x的新版本中,在意图上有一些变化。意图就像权限。您需要定义它,以便向频道、成员等发送消息

进口不和 意图=不和谐 client=discord.Botprefix=,intents=intents 有关详细信息,您可以检查。

ctx.guild.owner为“无”,因此无法获得“提及”属性