having trouble getting my discord bot to list all the members of the only guild it's added to..
async def on_ready(self):
print("logged in as {0}".format(self.user))
guilds = self.guilds
print("guilds: " + str(guilds))
guild = self.get_guild(my_guild_id)
print("guild members: " + str(guild.members))
The interesting thing is that when i print out the guild itself it shows a member count of 5 (which is correct). However when instantiate the Guild object, and access the members property, it only shows the bot user itself as the member.
guild members: [<Member id=12345678 name='testapp1_bot' discriminator='0683' bot=True nick=None guild=<Guild id=12345 name="ethandrower's server" shard_id=None chunked=False member_count=5>>]
guilds: [<Guild id=12345 name="ethandrower's server" shard_id=None chunked=False member_count=5>]
I'm guessing this either my misunderstanding of the architecture of 'guilds' or a permissions on the bot thing. I've added the bot to the server with full administrator access, so I'm a little stumped as to why I can see the proper count of members, but not the Member objects themselves?
Any help would be greatly appreciated!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…