为了账号安全,请及时绑定邮箱和手机立即绑定

Discord.ext.commands.errors.CommandInvokeError:

Discord.ext.commands.errors.CommandInvokeError:

幕布斯7119047 2023-12-20 19:58:13
我的代码:@commands.command(pass_context=True)@commands.guild_only()async def owner_mention(self, ctx):    await ctx.send(ctx.guild.owner.mention)错误:Discord.ext.commands.errors.CommandInvokeError:命令引发异常:AttributeError:“NoneType”对象没有属性“提及”

1 回答

?
胡子哥哥

TA贡献1825条经验 获得超6个赞

在新版本的discord.py(1.5.x)中,Intents. 意图就像权限。您需要定义它来向频道、成员等发送消息。

import discord

intents = discord.Intents().all()
client = discord.Bot(prefix='', intents=intents)


查看完整回答
反对 回复 2023-12-20

没有找到匹配的内容?试试慕课网站内搜索吧

添加回答

代码语言

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号