Python 成员始终显示为脱机状态
我想制作一个显示成员状态(联机、脱机等)的配置文件命令Python 成员始终显示为脱机状态,python,python-3.x,discord,discord.py,Python,Python 3.x,Discord,Discord.py,我想制作一个显示成员状态(联机、脱机等)的配置文件命令 @client.command(passContent=True) @commands.has_角色(“您需要使用意图 在discord.py的1.5版中,意图是新的 在屏幕上激活意图 将此添加到代码的顶部 intents=discord.intents().all() client=commands.Bot(命令前缀='?',意图=意图) #或 bot=commands.bot(命令前缀='?',意图=意图) 那么一切都会好起来的
@client.command(passContent=True)
@commands.has_角色(“您需要使用意图
在discord.py的1.5版中,意图是新的
- 在屏幕上激活意图
- 将此添加到代码的顶部
intents=discord.intents().all()
client=commands.Bot(命令前缀='?',意图=意图)
#或
bot=commands.bot(命令前缀='?',意图=意图)
那么一切都会好起来的
您还可以通过加入discord.py服务器,请参见
@client.command(passContent=True)
@commands.has_role("You need to use Intents!
Intents are new in version 1.5 of discord.py
- Activate Intents on the discord developer portal
- Add this to the top of your code
intents = discord.Intents().all()
client = commands.Bot(command_prefix = '?',intents=intents)
# OR
bot = commands.Bot(command_prefix='?', intents=intents)