Require passing intents to Client and its subclasses

This commit is contained in:
Rapptz
2022-04-05 22:12:55 -04:00
parent 7770972041
commit 76cc2c2272
4 changed files with 34 additions and 6 deletions

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: