mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-22 00:13:01 +00:00
Fallback to an unavailable guild instead of an Object in interactions
This commit is contained in:
@@ -452,6 +452,10 @@ class Guild(Hashable):
|
||||
|
||||
return role
|
||||
|
||||
@classmethod
|
||||
def _create_unavailable(cls, *, state: ConnectionState, guild_id: int) -> Guild:
|
||||
return cls(state=state, data={'id': guild_id, 'unavailable': True}) # type: ignore
|
||||
|
||||
def _from_data(self, guild: GuildPayload) -> None:
|
||||
try:
|
||||
self._member_count = guild['member_count']
|
||||
|
Reference in New Issue
Block a user