public async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequest req, ILogger log) { string channel = req.Form["channel_id"]; string userId = req.Form["user_id"]; log.LogInformation($"User '{userId}' requested a fact in channel '{channel}'"); await _slack.BroadcastMessage(channel, "FUN FACT : 100% DES JABONAIS SONT NOIRS"); return new OkObjectResult(userId); }
public async Task <IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequest req, ILogger log) { string channel = req.Form["channel_id"]; string userId = req.Form["user_id"]; string text = req.Form["text"]; log.LogInformation($"User {userId} said {text}"); await _slack.BroadcastMessage(channel, text); return(new OkResult()); }