Skip to content

Commit a0c0193

Browse files
committed
Fix invalid type hinting of initial_channels in WS Connection (#460)
1 parent 8e91cec commit a0c0193

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

twitchio/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def __init__(
7676
token: str,
7777
*,
7878
client_secret: str = None,
79-
initial_channels: Union[list, tuple, Callable] = None,
79+
initial_channels: Union[List[str], Tuple[str, ...], Callable[[], Union[List[str], Tuple[str, ...]]], None] = None,
8080
loop: asyncio.AbstractEventLoop = None,
8181
heartbeat: Optional[float] = 30.0,
8282
retain_cache: Optional[bool] = True,

twitchio/ext/commands/bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import types
3232
import warnings
3333
from functools import partial
34-
from typing import Callable, Optional, Union, Coroutine, Dict, List, TYPE_CHECKING, Mapping, Awaitable
34+
from typing import Callable, Optional, Union, Coroutine, Dict, List, Tuple, TYPE_CHECKING, Mapping, Awaitable
3535

3636
from twitchio.client import Client
3737
from twitchio.http import TwitchHTTP
@@ -53,7 +53,7 @@ def __init__(
5353
*,
5454
prefix: Union[str, list, tuple, set, Callable, Coroutine],
5555
client_secret: str = None,
56-
initial_channels: Union[list, tuple, Callable] = None,
56+
initial_channels: Union[List[str], Tuple[str, ...], Callable[[], Union[List[str], Tuple[str, ...]]], None] = None,
5757
heartbeat: Optional[float] = 30.0,
5858
retain_cache: Optional[bool] = True,
5959
**kwargs,

twitchio/websocket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import time
3232
import traceback
3333
from functools import partial
34-
from typing import Union, Optional, List, TYPE_CHECKING
34+
from typing import Union, Callable, Optional, List, Tuple, TYPE_CHECKING
3535

3636
import aiohttp
3737

@@ -57,7 +57,7 @@ def __init__(
5757
client: "Client",
5858
token: str = None,
5959
modes: tuple = None,
60-
initial_channels: List[str] = None,
60+
initial_channels: Union[List[str], Tuple[str, ...], Callable[[], Union[List[str], Tuple[str, ...]]], None] = None,
6161
retain_cache: Optional[bool] = True,
6262
):
6363
self._loop = loop

0 commit comments

Comments
 (0)