diff options
| author | Rapptz <[email protected]> | 2021-01-24 05:21:13 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-01-24 05:21:13 -0500 |
| commit | 61884dd9acd1ed982ef5759f2c91f3c1319eb7cb (patch) | |
| tree | 23c6c8a0d08668a5f602d9918bdd49910807b2a8 /discord | |
| parent | [commands] Fix documented type of `Context.cog` (diff) | |
| download | discord.py-61884dd9acd1ed982ef5759f2c91f3c1319eb7cb.tar.xz discord.py-61884dd9acd1ed982ef5759f2c91f3c1319eb7cb.zip | |
Use member provided data in typing_start event if not in cache
Apparently Discord had this all along.
ref: #5965, #5983
Diffstat (limited to 'discord')
| -rw-r--r-- | discord/state.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/state.py b/discord/state.py index 1784fc5f..8e302fe3 100644 --- a/discord/state.py +++ b/discord/state.py @@ -1053,6 +1053,11 @@ class ConnectionState: member = channel.recipient elif isinstance(channel, TextChannel) and guild is not None: member = guild.get_member(user_id) + if member is None: + member_data = data.get('member') + if member_data: + member = Member(data=member_data, state=self, guild=guild) + elif isinstance(channel, GroupChannel): member = utils.find(lambda x: x.id == user_id, channel.recipients) |