|
@ -124,7 +124,6 @@ if TYPE_CHECKING: |
|
|
from .flags import MemberCacheFlags |
|
|
from .flags import MemberCacheFlags |
|
|
|
|
|
|
|
|
class _ClientOptions(TypedDict, total=False): |
|
|
class _ClientOptions(TypedDict, total=False): |
|
|
intents: Required[Intents] |
|
|
|
|
|
max_messages: NotRequired[Optional[int]] |
|
|
max_messages: NotRequired[Optional[int]] |
|
|
proxy: NotRequired[Optional[str]] |
|
|
proxy: NotRequired[Optional[str]] |
|
|
proxy_auth: NotRequired[Optional[aiohttp.BasicAuth]] |
|
|
proxy_auth: NotRequired[Optional[aiohttp.BasicAuth]] |
|
@ -295,7 +294,7 @@ class Client: |
|
|
The websocket gateway the client is currently connected to. Could be ``None``. |
|
|
The websocket gateway the client is currently connected to. Could be ``None``. |
|
|
""" |
|
|
""" |
|
|
|
|
|
|
|
|
def __init__(self, **options: Unpack[_ClientOptions]) -> None: |
|
|
def __init__(self, *, intents: Intents, **options: Unpack[_ClientOptions]) -> None: |
|
|
self.loop: asyncio.AbstractEventLoop = _loop |
|
|
self.loop: asyncio.AbstractEventLoop = _loop |
|
|
# self.ws is set in the connect method |
|
|
# self.ws is set in the connect method |
|
|
self.ws: DiscordWebSocket = None # type: ignore |
|
|
self.ws: DiscordWebSocket = None # type: ignore |
|
@ -328,7 +327,7 @@ class Client: |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
self._enable_debug_events: bool = options.pop('enable_debug_events', False) |
|
|
self._enable_debug_events: bool = options.pop('enable_debug_events', False) |
|
|
self._connection: ConnectionState[Self] = self._get_state(**options) |
|
|
self._connection: ConnectionState[Self] = self._get_state(intents=intents, **options) |
|
|
self._connection.shard_count = self.shard_count |
|
|
self._connection.shard_count = self.shard_count |
|
|
self._closing_task: Optional[asyncio.Task[None]] = None |
|
|
self._closing_task: Optional[asyncio.Task[None]] = None |
|
|
self._ready: asyncio.Event = MISSING |
|
|
self._ready: asyncio.Event = MISSING |
|
|