Since Python 1.5 of Discord, I can't get a list of members

Well, that's what it is. After upgrading Discord's python3 discord.py to 1.5.1, I couldn't get the member list.

Official commentary

The explanation was written in discordpy.readthedocs.io.

In summary, when upgrading Discord, you have to update the data before you get a list of members! It seems that.

How should I do it? ?? ??

As it was written in the official commentary earlier,

1. Update Discord website settings

Although it is written here, go to the Discord website and set up Privileged Gateway Intents.

2. Program editing

Updated basic settings at the beginning, though it is written here

First set like this.

import discord
intents = discord.Intents.default()
intents.members = True

Next time when you take discord.Client

discord.Client(intents=intents)

So, pass intents as an argument.

Finally, when getting the member information, execute the chunk function to browse the information.

await members.chunk(cache=True)
#After that, write the process to get the member information.

Summary!

From time to time, I thought the reference was something to read. Oware.

Recommended Posts

Since Python 1.5 of Discord, I can't get a list of members
[python] Get a list of instance variables
[Python] Get a list of folders only
Python: Get a list of methods for an object
Get the number of specific elements in a python list
Get a list of purchased DMM eBooks with Python + Selenium
How to get a list of built-in exceptions in python
Try to get a list of breaking news threads in Python.
I tried to create a list of prime numbers with python
I tried to get a list of AMI Names using Boto3
I get a can't set attribute when using @property in python
Get a list of files in a folder with python without a path
Display a list of alphabets in Python 3
Get a list of packages installed in your current environment with python
[Python / DynamoDB / boto3] List of operations I tried
[python] Create a list of various character types
Get the caller of a function in Python
Make a copy of the list in Python
Get a list of IAM users with Boto3
Get a list of Qiita likes by scraping
Get a glimpse of machine learning in Python
Get a list of articles posted by users with Python 3 Qiita API v2
Python script to get a list of input examples for the AtCoder contest
How to get a list of files in the same directory with python
Since memory_profiler of python is heavy, I measured it
[python] Get the list of classes defined in the module
How to write a list / dictionary type of Python3
[Python] Get the list of ExifTags names of Pillow library
[Python] I want to make a nested list a tuple
Group by consecutive elements of a list in Python
[Python] I tried to get Json of squid ring 2
I tried using Python (3) instead of a scientific calculator
Get the value of a specific key in a list from the dictionary type in the list with Python
I quarantined my environment with virtualenv, but I get a lot of packages with pip list
Try to get the function list of Python> os package
Summary of Python3 list operations
Python> Get a list of files in multiple directories> Use glob | Sort by modification time
How to shuffle a part of a Python list (at random.shuffle)
Get the value of a specific key up to the specified index in the dictionary list in Python
[Command] Command to get a list of files containing double-byte characters
python Condition extraction from a list that I often forget
I want to start a lot of processes from python
Developed a library to get Kindle collection list in Python
Python list is not a list
I tried "How to get a method decorated in Python"
How to get the last (last) value in a list in Python
Get index of nth largest / smallest value in list in Python
I tried to create a Python script to get the value of a cell in Microsoft Excel
Python: Create a dictionary from a list of keys and values
[Python] Copy of multidimensional list
I made a python text
I made a discord bot
Get a list of CloudWatch Metrics and a correspondence table for Unit units with Python boto
I tried a stochastic simulation of a bingo game with Python
How to get a list of links from a page from wikipedia
When I got a list of study sessions in Python, I found something I wanted to make
Get index of nth largest / smallest value in list in Python
[Python3] List of sites that I referred to when I started Python
Get images of great find / 47 sites using Python (Part 2/2: I published the target list on github)
I tried to get the index of the list using the enumerate function
I know, but I can't stop--Python is a collection of common mistakes