So, I am working on a private discord bot with kinda like an onlinestreak. And for that i need to get all members. Im tying to use fetch_members and for that i have to have the members intent. But trying to set it literaly anywhere, in the on_ready, the init and i even tried to modify the library for that, but nothing worked.
import discord
from discord.ext import commands, tasks
from dataclasses import dataclass
class MyClient(discord.Client):
async def on_ready(self):
self.intents = discord.Intents().all()
print('Logged on as {self.user}!')
self.userlist = []
print((self.get_guild("id")).fetch_members())
client = MyClient()
client.intents = discord.Intents().all()
client.run("token")
The error message always says
Ignoring exception in on_ready
Traceback (most recent call last):
File "C:\Users\woelf\AppData\Local\Programs\Python\Python39\lib\site-
packages\discord\client.py", line 344, in _run_event
await coro(*args, **kwargs)
File "main.py", line 25, in on_ready
self.intents = discord.Intents().all()
AttributeError: can't set attribute
Any one got an idea how to fix this?