Skip to content

Instantly share code, notes, and snippets.

@isdaviddong
Created August 3, 2020 14:31
Show Gist options
  • Select an option

  • Save isdaviddong/7b5838e6ace41f7ba0ec6ae71daf4d51 to your computer and use it in GitHub Desktop.

Select an option

Save isdaviddong/7b5838e6ace41f7ba0ec6ae71daf4d51 to your computer and use it in GitHub Desktop.
showQuickReplyMessage.cs
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