mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-08 17:49:03 +00:00
Add Object.type to Objects where a type can be determined
This commit is contained in:
4 files changed
+57
-33
No files matched your search
+2
-2
@@ -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