Discord.py,client.get_all_members()不起作用

时间:2020-11-05 17:38:53

标签: discord.py

import discord
from discord.ext import commands
import asyncio
import time

client= commands.Bot(command_prefix= '.')
@client.event
async def on_ready():
    for a in client.get_all_members():
        time.sleep(1)
        print(a)

这段代码以前给了我服务器成员的权限,允许我为成员创建DM,但是几天前它停止工作,现在只给我显示机器人名称。

1 个答案:

答案 0 :(得分:0)

这已在几周前更改。检出intents

https://discordpy.readthedocs.io/ja/latest/intents.html