'when getting server members with await server.fetch_members().flatten() returns no member.activities value

When I try and get all the members in a server and then try and get their activities value it returns none () for every user. I am using discord.py my code:

import discord
from discord.ext import commands
intents = discord.Intents.all()
bot = commands.Bot(command_prefix='.', intents=intents)
@bot.eventclient.get_guild(guild_id)
async def on_ready():
    serverlist = await bot.fetch_guilds().flatten()
    for server in serverlist:
        async for _member in server.fetch_members():
            print(_member.activities)
    
bot.run('TOKEN')


Solution 1:[1]

This problem could have 2 solutions:

1: Do you have the members intent enabled on the Discord developer page? if not, enable it.

2: I'm not Shure how await bot.fetch_guilds().flatten() Works. I always use client.guilds to get a list with all guilds. Maybe this helps you.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kollhdxdlp