As discussed on Discord, if the app sends a chat message while pyTwitchAPI is in recovery mode, send_message will stack trace with ConnectResetError. Relevant part of the stack trace:
...
File "/Users/aw/Src/whats-now-playing/nowplaying/twitch/chat.py", line 368, in _post_template
await self.chat.send_message(
File "/Users/aw/wnpvenv/lib/python3.10/site-packages/twitchAPI/chat.py", line 799, in send_message
await self._send_message(f'PRIVMSG {room} :{text}')
File "/Users/aw/wnpvenv/lib/python3.10/site-packages/twitchAPI/chat.py", line 612, in _send_message
await self.__connection.send_str(message)
File "/Users/aw/wnpvenv/lib/python3.10/site-packages/aiohttp/client_ws.py", line 151, in send_str
await self._writer.send(data, binary=False, compress=compress)
File "/Users/aw/wnpvenv/lib/python3.10/site-packages/aiohttp/http_websocket.py", line 690, in send
await self._send_frame(message, WSMsgType.TEXT, compress)
File "/Users/aw/wnpvenv/lib/python3.10/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
As discussed on Discord, if the app sends a chat message while pyTwitchAPI is in recovery mode, send_message will stack trace with ConnectResetError. Relevant part of the stack trace: