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()); }
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(); }