Esempio n. 1
0
        public static async Task <IActionResult> OnPropose(
            [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "slack/commands/propose")] HttpRequest req,
            IBinder binder, ExecutionContext context)
        {
            Utils.SetCulture();

            var body = await SlackHelper.ReadSlackRequest(req, context);

            var parameters = SlackHelper.ParseBody(body);

            var dialogRequest = new OpenDialogRequest {
                TriggerId = parameters["trigger_id"],
                Dialog    = DialogHelpers.GetProposeDialog(defaultName: parameters["text"])
            };

            await SlackHelper.OpenDialog(binder, parameters["team_id"], dialogRequest);

            return(Utils.Ok());
        }