Created
August 3, 2020 14:31
-
-
Save isdaviddong/7b5838e6ace41f7ba0ec6ae71daf4d51 to your computer and use it in GitHub Desktop.
showQuickReplyMessage.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| namespace imagemaptest | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var AdminUserId = "___________AdminUserId____________"; | |
| var ChannelAccessToken = "____ChannelAccessToken______"; | |
| var bot = new isRock.LineBot.Bot(ChannelAccessToken); | |
| //傳送訊息 | |
| var msg = new isRock.LineBot.TextMessage("test"); | |
| var IconUrl = "https://arock.blob.core.windows.net/blogdata202008/People.png"; | |
| //在TextMessage物件的quickReply屬性中加入items | |
| msg.quickReply.items.Add( | |
| new isRock.LineBot.QuickReplyMessageAction( | |
| $"一般標籤", "點選後顯示的text文字")); | |
| msg.quickReply.items.Add( | |
| new isRock.LineBot.QuickReplyMessageAction( | |
| $"有圖示的標籤", "點選後顯示的text文字", new Uri(IconUrl))); | |
| //加入QuickReplyDatetimePickerAction | |
| msg.quickReply.items.Add( | |
| new isRock.LineBot.QuickReplyDatetimePickerAction( | |
| "選時間", "選時間", isRock.LineBot.DatetimePickerModes.datetime, new Uri(IconUrl))); | |
| //加入QuickReplyLocationAction | |
| msg.quickReply.items.Add( | |
| new isRock.LineBot.QuickReplyLocationAction( | |
| "選地點", new Uri(IconUrl))); | |
| //加入QuickReplyCameraAction | |
| msg.quickReply.items.Add( | |
| new isRock.LineBot.QuickReplyCameraAction( | |
| "Show Camera", new Uri(IconUrl))); | |
| //加入QuickReplyCamerarollAction | |
| msg.quickReply.items.Add( | |
| new isRock.LineBot.QuickReplyCamerarollAction( | |
| "Show Cameraroll", new Uri(IconUrl))); | |
| //發送 | |
| bot.PushMessage(AdminUserId, msg); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment