I'm making a Discord bot and want to use guild.members to get a list of all the members. I encountered a problem which is that guild.members is only returning the bot itself, and not any member in the server.
What I tried was to enable intents in my code and in the Discord developers portal but it still did not make a change.
My issue it that I'm trying to use guild.members using a user token but it isn't working.
My code:
import discord
from discord.ext import commands
from discord.ext.commands import bot
from discord.flags import Intents
intents = discord.Intents().all()
bot = commands.Bot(command_prefix='!',intents=intents)
guild = bot.get_guild(790189441695350807)
@bot.event
async def on_ready():
await uwu()
async def uwu():
for i in guild.members:
print(i)
bot.run(LmaoWhyYouTrynaStealMyToken>:c)