|
23 | 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
24 | 24 | DEALINGS IN THE SOFTWARE. |
25 | 25 | """ |
| 26 | +from __future__ import annotations |
26 | 27 |
|
27 | 28 | import asyncio |
28 | 29 | from collections import deque, OrderedDict |
|
36 | 37 | import gc |
37 | 38 |
|
38 | 39 | import os |
39 | | -from typing import Union |
| 40 | +from typing import Union, TYPE_CHECKING |
40 | 41 |
|
41 | 42 | from .guild import Guild |
42 | 43 | from .activity import BaseActivity |
|
60 | 61 | from .interactions import BaseInteraction, InteractionType |
61 | 62 |
|
62 | 63 |
|
| 64 | +if TYPE_CHECKING: |
| 65 | + from .http import HTTPClient |
| 66 | + |
| 67 | + |
63 | 68 | class ChunkRequest: |
64 | 69 | def __init__(self, guild_id, loop, resolver, *, cache=True): |
65 | 70 | self.guild_id = guild_id |
@@ -114,7 +119,7 @@ async def logging_coroutine(coroutine, *, info): |
114 | 119 | class ConnectionState: |
115 | 120 | def __init__(self, *, dispatch, handlers, hooks, syncer, http, loop, **options): |
116 | 121 | self.loop = loop |
117 | | - self.http = http |
| 122 | + self.http: HTTPClient = http |
118 | 123 | self.max_messages = options.get('max_messages', 1000) |
119 | 124 | if self.max_messages is not None and self.max_messages <= 0: |
120 | 125 | self.max_messages = 1000 |
@@ -1313,10 +1318,10 @@ def get_channel(self, id): |
1313 | 1318 | if channel is not None: |
1314 | 1319 | return channel |
1315 | 1320 |
|
1316 | | - |
1317 | 1321 | def create_message(self, *, channel, data): |
1318 | 1322 | return Message(state=self, channel=channel, data=data) |
1319 | 1323 |
|
| 1324 | + |
1320 | 1325 | class AutoShardedConnectionState(ConnectionState): |
1321 | 1326 | def __init__(self, *args, **kwargs): |
1322 | 1327 | super().__init__(*args, **kwargs) |
|
0 commit comments