Exemplo n.º 1
0
        public async Task <IActionResult> Post([FromForm] SlackRequest request)
        {
            if (request != null)
            {
                var spokenText = await _talkingService.TextToTalk(request.Text, "eng");

                if (spokenText != null)
                {
                    _slackClient.SendAudio(spokenText, request.Channel_Name, request.Text);
                }
                return(Ok());
            }
            return(BadRequest());
        }
Exemplo n.º 2
0
 public void Post([FromForm] SlackRequest request)
 {
     if (request != null)
     {
         var spokenText = System.IO.File.ReadAllBytes(Directory.GetCurrentDirectory() + "\\Assets\\despacito.mp3");
         if (spokenText != null)
         {
             _slackClient.SendAudio(spokenText, request.Channel_Name, "despascito");
         }
         Ok();
     }
     BadRequest();
 }