[英]Discord.py: NameError: name 'intents' is not defined
我正在尝试在我的机器人中使用意图,但在运行以下代码时:
import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix=prefix, intent=intents)
我收到错误:
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discor
Traceback (most recent call last):
File "main.py", line 3, in <module>
intents = discord.Intents.default()
AttributeError: module 'discord' has no attribute 'Intents'
我正在运行 Python 3.8.2,但我不知道为什么会这样。 任何帮助都会得到认可(:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.