Use Unpack where it's possible

This commit is contained in:
Soheab
2025-08-15 11:36:36 +02:00
committed by GitHub
parent 13432591c6
commit 983a9b8f94
13 changed files with 383 additions and 103 deletions

View File

@ -52,6 +52,12 @@ if TYPE_CHECKING:
from .activity import BaseActivity
from .flags import Intents
from .types.gateway import SessionStartLimit
from .client import _ClientOptions
class _AutoShardedClientOptions(_ClientOptions, total=False):
shard_ids: List[int]
shard_connect_timeout: Optional[float]
__all__ = (
'AutoShardedClient',
@ -365,7 +371,7 @@ class AutoShardedClient(Client):
if TYPE_CHECKING:
_connection: AutoShardedConnectionState
def __init__(self, *args: Any, intents: Intents, **kwargs: Any) -> None:
def __init__(self, *args: Any, intents: Intents, **kwargs: Unpack[_AutoShardedClientOptions]) -> None:
kwargs.pop('shard_id', None)
self.shard_ids: Optional[List[int]] = kwargs.pop('shard_ids', None)
self.shard_connect_timeout: Optional[float] = kwargs.pop('shard_connect_timeout', 180.0)