diff options
| author | Rapptz <[email protected]> | 2021-08-22 07:36:39 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-08-22 07:36:39 -0400 |
| commit | d17551f51f19753f1b4c8896c0139ea82829fdc0 (patch) | |
| tree | 2ac250e8fe71136ab4944103923213ffc943cafa /discord/state.py | |
| parent | Add missing typehint for PermissionOverwrite.pair (diff) | |
| download | discord.py-d17551f51f19753f1b4c8896c0139ea82829fdc0.tar.xz discord.py-d17551f51f19753f1b4c8896c0139ea82829fdc0.zip | |
Fix typing for private channel by user lookup
Diffstat (limited to 'discord/state.py')
| -rw-r--r-- | discord/state.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/state.py b/discord/state.py index a652d9de..2534e7aa 100644 --- a/discord/state.py +++ b/discord/state.py @@ -261,7 +261,7 @@ class ConnectionState: # LRU of max size 128 self._private_channels: OrderedDict[int, PrivateChannel] = OrderedDict() # extra dict to look up private channels by user id - self._private_channels_by_user: Dict[int, PrivateChannel] = {} + self._private_channels_by_user: Dict[int, DMChannel] = {} if self.max_messages is not None: self._messages: Optional[Deque[Message]] = deque(maxlen=self.max_messages) else: @@ -421,7 +421,7 @@ class ConnectionState: self._private_channels.move_to_end(channel_id) # type: ignore return value - def _get_private_channel_by_user(self, user_id: Optional[int]) -> Optional[PrivateChannel]: + def _get_private_channel_by_user(self, user_id: Optional[int]) -> Optional[DMChannel]: # the keys of self._private_channels are ints return self._private_channels_by_user.get(user_id) # type: ignore |