Whisk the cocoa, flour, and sugar together in a bowl until there are no lumps. Pour the milk into the mixture and whisk until well incorporated. Transfer the mixture to a saucepan and cook over medium heat, stirring frequently, until its consistency is similar to gravy, 7 to 10 minutes. Remove from heat and stir the butter and vanilla into the mixture until the butter is melted. Serve immediately.