mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
Remove unbound remnants of Guild._member_count
Since now it's always Optional[int]
This commit is contained in:
parent
03687fb616
commit
9c054e9222
@ -392,7 +392,7 @@ class Guild(Hashable):
|
|||||||
('name', self.name),
|
('name', self.name),
|
||||||
('shard_id', self.shard_id),
|
('shard_id', self.shard_id),
|
||||||
('chunked', self.chunked),
|
('chunked', self.chunked),
|
||||||
('member_count', getattr(self, '_member_count', None)),
|
('member_count', self._member_count),
|
||||||
)
|
)
|
||||||
inner = ' '.join('%s=%r' % t for t in attrs)
|
inner = ' '.join('%s=%r' % t for t in attrs)
|
||||||
return f'<Guild {inner}>'
|
return f'<Guild {inner}>'
|
||||||
@ -567,10 +567,9 @@ class Guild(Hashable):
|
|||||||
members, which for this library is set to the maximum of 250.
|
members, which for this library is set to the maximum of 250.
|
||||||
"""
|
"""
|
||||||
if self._large is None:
|
if self._large is None:
|
||||||
try:
|
if self._member_count is not None:
|
||||||
return self._member_count >= 250
|
return self._member_count >= 250
|
||||||
except AttributeError:
|
return len(self._members) >= 250
|
||||||
return len(self._members) >= 250
|
|
||||||
return self._large
|
return self._large
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -988,7 +987,7 @@ class Guild(Hashable):
|
|||||||
If this value returns ``False``, then you should request for
|
If this value returns ``False``, then you should request for
|
||||||
offline members.
|
offline members.
|
||||||
"""
|
"""
|
||||||
count = getattr(self, '_member_count', None)
|
count = self._member_count
|
||||||
if count is None:
|
if count is None:
|
||||||
return False
|
return False
|
||||||
return count == len(self._members)
|
return count == len(self._members)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user