0

This is my code.

bot = commands.Bot(command_prefix='-', description='A random bot')
.
.
.
guild = bot.get_guild(760036721978507266)
member_count = guild.member_count
print(member_count)

I am trying to get the number of members (excluding bots) but returning

Traceback (most recent call last):
  File "C:\Users\X\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\ext\tasks\__init__.py", line 101, in _loop
    await self.coro(*args, **kwargs)
  File "c:/Users/X/Desktop/Coding/bot/new.py", line 626, in everymin
    member_count = guild.member_count
AttributeError: 'NoneType' object has no attribute 'member_count'

any idea how to fix this?

Ryan Tsui
  • 1
  • 2

0 Answers0