Answer the question
In order to leave comments, you need to log in
How to get a list of all channel members (Discord.py)?
The number of participants on the server is displayed correctly.
But I need a list of them. And I get only those users who are in voice channels.
@client.event
...
elif message.content.startswith('!m'): # Show all members ->
for guild in client.guilds:
for member in guild.members:
print(member)
print(guild.member_count)
...
Answer the question
In order to leave comments, you need to log in
You need to enable members intent.
import discord
intents = discord.Intents.default()
intents.members = True
client = discord.Client(intents=intents)
# или
# bot = commands.Bot(command_prefix='!', intents=intents)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question