Skip to content

Commit a8e7ece

Browse files
authored
added heartbeat to from_client_credentials. fixes #184 (#185)
1 parent dc76c2d commit a8e7ece

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

twitchio/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def from_client_credentials(
9696
client_secret: str,
9797
*,
9898
loop: asyncio.AbstractEventLoop = None,
99+
heartbeat: Optional[float] = 30.0,
99100
) -> "Client":
100101
"""
101102
creates a client application token from your client credentials.
@@ -124,8 +125,9 @@ def from_client_credentials(
124125
self = cls.__new__(cls)
125126
self.loop = loop or asyncio.get_event_loop()
126127
self._http = TwitchHTTP(self, client_id=client_id, client_secret=client_secret)
128+
self._heartbeat = heartbeat
127129
self._connection = WSConnection(
128-
client=self, loop=self.loop, initial_channels=None
130+
client=self, loop=self.loop, initial_channels=None, heartbeat=self._heartbeat
129131
) # The only reason we're even creating this is to avoid attribute errors
130132
self._events = {}
131133
self._waiting = []

0 commit comments

Comments
 (0)