How to make players go to bed without them doing it (With command blocks)

Solution 1:

Okay got an answer. Actually I am going to teleport players in a black box and going to give them invisibility so they can't see their hand.