Require passing intents to Client and its subclasses

This commit is contained in:
Rapptz committed 2022-04-05 22:32:14 -04:00
1 parent 7770972041
commit 76cc2c2272
4 files changed
+34 -6

No files matched your search

+3 -2
View File
@@ -48,6 +48,7 @@ from typing import TYPE_CHECKING, Any, Callable, Tuple, Type, Optional, List, Di
if TYPE_CHECKING:
from .gateway import DiscordWebSocket
from .activity import BaseActivity
from .flags import Intents
__all__ = (
'AutoShardedClient',
@@ -316,10 +317,10 @@ class AutoShardedClient(Client):
if TYPE_CHECKING:
_connection: AutoShardedConnectionState
def __init__(self, *args: Any, **kwargs: Any) -> None:
def __init__(self, *args: Any, intents: Intents, **kwargs: Any) -> None:
kwargs.pop('shard_id', None)
self.shard_ids: Optional[List[int]] = kwargs.pop('shard_ids', None)
super().__init__(*args, **kwargs)
super().__init__(*args, intents=intents, **kwargs)
if self.shard_ids is not None:
if self.shard_count is None: