mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-20 13:29:03 +00:00
Fallback to an unavailable guild instead of an Object in interactions
This commit is contained in:
1 parent
781b297ac9
commit
573bb32a1e
4 files changed
+10
-6
No files matched your search
@@ -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