Automatically check “Allow comments” for custom post type [duplicate]

This answer here fixed it for me:
https://wordpress.stackexchange.com/a/243732/138177

add_filter( 'comments_open', 'my_comments_open', 10, 2 );

function my_comments_open( $open, $post_id ) {

  $post = get_post( $post_id );

  if ( 'myCustomPostType' == $post->post_type )
      $open = true;

  return $open;
}