You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Python Discord Bot运行报错:Missing Privileged Intents问题求助

解决Discord Bot "Missing Privileged Intents"错误

问题原因

你在代码中启用了members特权意图,但未在Discord开发者门户中开启对应权限,导致Bot连接Discord时验证失败。

修复步骤

  • 打开Discord开发者门户,找到你的Bot应用
  • 进入Bot页面,下滑至Privileged Gateway Intents区域
  • 开启Server Members Intent的开关,保存更改
  • 重启你的Bot程序,重新运行代码

代码确认(你的代码已正确配置)

确保代码中意图设置无误:

intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix='!', intents=intents)

补充说明:如果后续你的Bot需要处理消息内容,且使用的是discord.py v2.x及以上版本,还需在开发者门户开启Message Content Intent,并在代码中添加intents.message_content = True。

内容的提问来源于stack exchange,提问作者SmartpyMOS

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.24 20:49:56