//ConfirmTemplate protected void Button2_Click(object sender, EventArgs e) { var bot = new isRock.LineBot.Bot(channelAccessToken); var CarouselTmpMsg = new isRock.LineBot.ConfirmTemplate() { text = "文字", altText = "替代文字", }; //add actions var action1 = new isRock.LineBot.MessageAction() { label = "OK", text = "呈現的文字" }; CarouselTmpMsg.actions.Add(action1); var action2 = new isRock.LineBot.UriAction() { label = "NO", uri = new Uri("http://www.google.com") }; CarouselTmpMsg.actions.Add(action2); bot.PushMessage(AdminUserId, CarouselTmpMsg); }
//ButtonsTemplate protected void Button1_Click(object sender, EventArgs e) { var bot = new isRock.LineBot.Bot(channelAccessToken); var ButtonTmpMsg = new isRock.LineBot.ButtonsTemplate() { text = "文字", title = "標題", altText = "替代文字", thumbnailImageUrl = new Uri("https://66.media.tumblr.com/2e37eafc9b6b715ed99b31fb6f72e6a5/tumblr_inline_pjjzfnFy7a1u06gc8_640.jpg") }; //add actions var action1 = new isRock.LineBot.MessageAction() { label = "顯示的標題", text = "呈現的文字" }; ButtonTmpMsg.actions.Add(action1); var action2 = new isRock.LineBot.UriAction() { label = "顯示的標題", uri = new Uri("http://www.google.com") }; ButtonTmpMsg.actions.Add(action2); bot.PushMessage(AdminUserId, ButtonTmpMsg); }