Exemplo n.º 1
0
        public HttpResponseMessage Post(SlackOutgoingContent query)
        {
            string strReplyMessage = $"你輸入的訊息是{query.text}";
            string strResult       = "";

            // 呼叫回送至Slack的function
            try
            {
                SlackMessageQuery objReply = new SlackMessageQuery()
                {
                    text = strReplyMessage,
                };

                strResult = new SlackMessageObj().SendMessage(objReply);
            }
            catch (Exception e)
            {
                code = HttpStatusCode.BadRequest;
            }
            // 找出內容

            return(Request.CreateResponse(HttpStatusCode.OK, strResult));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Post進Slack訊息的動作
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public HttpResponseMessage Post(SlackMessageQuery query)
        {
            string strResult = new SlackMessageObj().SendMessage(query);

            return(Request.CreateResponse(code, strResult));
        }