dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
680 stars 161 forks source link

AttributeError: 'Guild' object has no attribute 'fetch_members' #438

Closed Lyfhael closed 1 year ago

Lyfhael commented 1 year ago

Summary

Guild should have attribute fetch_members

Reproduction Steps

Code

import discord, requests, json

class MyClient(discord.Client):
  async def on_ready(self):
    print('Logged on as', self.user)
  async def on_message(self, message):
    guild = self.get_guild(self.guilds[0].id)
    print(guild.id)
    print(await guild.fetch_members(guild.id, force_scraping=True))

client = MyClient()

Code

see `Reproduction Steps`

Expected Results

no error message and member list returnd

Actual Results

Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\Lyfe\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\client.py", line 301, in _run_event await coro(*args, **kwargs) File "C:\Users\Lyfe\Documents\Programs\discord_scraping_project\server_access.py", line 9, in on_message print(await guild.fetch_members(guild.id, force_scraping=True)) ^^^^^^^^^^^^^^^^^^^ AttributeError: 'Guild' object has no attribute 'fetch_members'

System Information

Checklist

Additional Information

No response

Lyfhael commented 1 year ago

Here is the reference that fetch_members() should be an attribute of Guild object : https://discordpy-self.readthedocs.io/en/latest/api.html#discord.Guild.fetch_members

Lyfhael commented 1 year ago

It didn't work on my Windows machine but worked on my debian machine