Skip to content

Instantly share code, notes, and snippets.

@isdaviddong
Last active January 23, 2019 09:56
Show Gist options
  • Select an option

  • Save isdaviddong/2ad2ab681580070fce766dfc60a27b7e to your computer and use it in GitHub Desktop.

Select an option

Save isdaviddong/2ad2ab681580070fce766dfc60a27b7e to your computer and use it in GitHub Desktop.
const string token = ""; //換成你的token
const string AdminUserId = ""; //換成你的UserId
//發送貼圖鈕
private void button2_Click(object sender, EventArgs e)
{
isRock.LineBot.Bot bot = new isRock.LineBot.Bot(token);
//發送貼圖
bot.PushMessage(AdminUserId, 1,2);
}
//發送圖片鈕
private void button3_Click(object sender, EventArgs e)
{
isRock.LineBot.Bot bot = new isRock.LineBot.Bot(token);
//指定圖片位置
Uri imgURL = new Uri("https://arock.blob.core.windows.net/blogdata201706/22-124357-ad3c87d6-b9cc-488a-8150-1c2fe642d237.png");
//發送圖片
bot.PushMessage(AdminUserId,imgURL);
}
private void button1_Click(object sender, EventArgs e)
{
var token = "!!! 換成你的Token!!!";
var AdminUserId = "!!! 換成你的UserId!!!";
isRock.LineBot.Bot bot = new isRock.LineBot.Bot(token);
bot.PushMessage(AdminUserId, "測試訊息");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment