mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-23 00:42:56 +00:00
Implement AutoShardedClient for transparent sharding.
This allows people to run their >2,500 guild bot in a single process without the headaches of IPC/RPC or much difficulty.
This commit is contained in:
@@ -324,6 +324,14 @@ class Guild(Hashable):
|
||||
"""Returns the true member count regardless of it being loaded fully or not."""
|
||||
return self._member_count
|
||||
|
||||
@property
|
||||
def shard_id(self):
|
||||
"""Returns the shard ID for this guild if applicable."""
|
||||
count = self._state.shard_count
|
||||
if count is None:
|
||||
return None
|
||||
return (self.id >> 22) % count
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""Returns the guild's creation time in UTC."""
|
||||
|
Reference in New Issue
Block a user