telnet_writer.write is not an async method - drain() is. Remove async keyword so the call is the same as for the text websocket.