Browse Source

Add missing type: ignore and missing typehint to channel.py

pull/7466/head
Stocker 4 years ago
committed by GitHub
parent
commit
ae01a96bef
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      discord/channel.py

4
discord/channel.py

@ -86,6 +86,7 @@ if TYPE_CHECKING:
StoreChannel as StoreChannelPayload, StoreChannel as StoreChannelPayload,
GroupDMChannel as GroupChannelPayload, GroupDMChannel as GroupChannelPayload,
) )
from .types.snowflake import SnowflakeList
async def _single_delete_strategy(messages: Iterable[Message]): async def _single_delete_strategy(messages: Iterable[Message]):
@ -392,7 +393,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
if len(messages) > 100: if len(messages) > 100:
raise ClientException('Can only bulk delete messages up to 100 messages') raise ClientException('Can only bulk delete messages up to 100 messages')
message_ids: List[int] = [m.id for m in messages] message_ids: SnowflakeList = [m.id for m in messages]
await self._state.http.delete_messages(self.id, message_ids) await self._state.http.delete_messages(self.id, message_ids)
async def purge( async def purge(
@ -1709,6 +1710,7 @@ class DMChannel(discord.abc.Messageable, Hashable):
self._state = state self._state = state
self.id = channel_id self.id = channel_id
self.recipient = None self.recipient = None
# state.user won't be None here
self.me = state.user # type: ignore self.me = state.user # type: ignore
return self return self

Loading…
Cancel
Save