@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)
...
import discord
intents = discord.Intents.default()
intents.members = True
client = discord.Client(intents=intents)
# или
# bot = commands.Bot(command_prefix='!', intents=intents)