예제 #1
0
        protected async Task <bool> Respond(SlackRequest request, SlackResponse response)
        {
            var httpResponse = await HttpClient.SendAsync(new HttpRequestMessage {
                RequestUri = new Uri(request.ResponseUrl),
                Method     = HttpMethod.Post,
                Content    = new StringContent(SerializeJson(response))
            });

            return(httpResponse.StatusCode == HttpStatusCode.OK);
        }
예제 #2
0
        protected async Task <bool> Respond(SlackRequest request, SlackResponse response)
        {
            var httpResponse = await HttpClient.SendAsync(new HttpRequestMessage {
                RequestUri = new Uri(request.ResponseUrl),
                Method     = HttpMethod.Post,
                Content    = new StringContent(JsonConvert.SerializeObject(response), Encoding.UTF8, "application/json")
            });

            return(httpResponse.StatusCode == HttpStatusCode.OK);
        }
예제 #3
0
 protected Task <bool> RespondEphemeral(SlackRequest request, string text, params SlackResponseAttachment[] attachments)
 => Respond(request, SlackResponse.Ephemeral(text, attachments));
예제 #4
0
 protected Task <bool> RespondInChannel(SlackRequest request, string text, params SlackResponseAttachment[] attachments)
 => Respond(request, SlackResponse.InChannel(text, attachments));