DiscordPy bot cannot detect members in same guild anymore

  discord, discord.py, python

I have recently updated my python version from 3.7 to 3.8.6 (as DiscordPy does not support 3.9). because of this, I had to ‘repip’ discord. Earlier, My Bot would have been able to detect all the users (members) in the channel.

For example:

async def members(message):                                         
    x = message.guild.members
    for member in x:
        await message.channel.send(member.name) 

would have cycled through the list of members and send the name. Now, the bot will only send out its own name. I am in a private testing server with friends so I have given the Bot Admin privileges. what change occurred and how can I adapt my code to do what it was intended to do earlier?

Source: Python Questions

LEAVE A COMMENT