Remove generic from Interaction and ConnectionState

This results in poor ergonomics due to the lack of default generics
for the common case. For most users this ends up in a degraded
experience since the type will resolve to Unknown rather than at the
very least a Client.
This commit is contained in:
Rapptz
2022-03-05 05:03:23 -05:00
parent aa74238053
commit f7315573aa
4 changed files with 10 additions and 15 deletions

View File

@@ -77,7 +77,6 @@ from .threads import Thread
from .sticker import GuildSticker, StandardSticker, StickerPack, _sticker_factory
if TYPE_CHECKING:
from typing_extensions import Self
from .types.guild import Guild as GuildPayload
from .abc import SnowflakeTime, Snowflake, PrivateChannel
from .guild import GuildChannel
@@ -255,7 +254,7 @@ class Client:
}
self._enable_debug_events: bool = options.pop('enable_debug_events', False)
self._connection: ConnectionState[Self] = self._get_state(**options)
self._connection: ConnectionState = self._get_state(**options)
self._connection.shard_count = self.shard_count
self._closed: bool = False
self._ready: asyncio.Event = asyncio.Event()