After the Songbird Serenade's concert, Capper, Princess Skystar, and Captain Celaeno agreed to spend the night at Canterlot. Twilight had some thinking, yelling at Pinkie Pie was a bad idea, so she decided to continue her apology to her and her other best friends after Rainbow Dash interrupted when they were in the battle between them and the Storm King. Also, Spike talks to Capper, Skystar, and Celaeno about how he trusts them for sticking by his and the girls' side against the Storm King.
Sweetness ensues.
This is what the creators should've done in the movie.