ShadMilkGod
ShadMilkGod

Reputation: 63

discord py, ctx.guild.members, only returns bot

ctx.guild.members

is an array which is supposed to return every member in the server the command was called from but if i do

print(ctx.guild.members)

it only returns the bot itself

[<Member id=769576973214547969 name='test bot' discriminator='2461' bot=True nick=None guild=<Guild id=768187276873957437 name='test server' shard_id=None chunked=False member_count=4>>]

im trying to meet the quality standards which is why its worded long and not to the point

Upvotes: 4

Views: 4887

Answers (1)

Nurqm
Nurqm

Reputation: 4743

In the new version of discord.py(1.5.x), there're some updates about Intents. Intents are like permissions, you have to define it to use some things like getting members, channels etc.

import discord

intents = discord.Intents().all()
client = discord.Bot(prefix = '', intents=intents)

For more information about Intents, you can look at the API References.

Upvotes: 6

Related Questions