mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 09:56:09 +00:00
Add Object.type to Objects where a type can be determined
This commit is contained in:
@ -1885,8 +1885,8 @@ class Client:
|
||||
else:
|
||||
# the factory can't be a DMChannel or GroupChannel here
|
||||
guild_id = int(data['guild_id']) # type: ignore
|
||||
guild = self.get_guild(guild_id) or Object(id=guild_id)
|
||||
# GuildChannels expect a Guild, we may be passing an Object
|
||||
guild = self._connection._get_or_create_unavailable_guild(guild_id)
|
||||
# the factory should be a GuildChannel or Thread
|
||||
channel = factory(guild=guild, state=self._connection, data=data) # type: ignore
|
||||
|
||||
return channel
|
||||
|
Reference in New Issue
Block a user