Skip to content

Instantly share code, notes, and snippets.

@isdaviddong
Created August 3, 2020 13:55
Show Gist options
  • Select an option

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

Select an option

Save isdaviddong/b537a8c4507ff10bbf07bde4d4aad3f7 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
namespace linepushtest
{
class Program
{
static void Main(string[] args)
{
var AdminUserId = "___AdminUserId___";
var ChannelAccessToken = "___ChannelAccessToken___";
var bot = new isRock.LineBot.Bot(ChannelAccessToken);
var flexContents = @"
___Replace__All__This__With__FLEX__MESSAGE__SIMULATOR__JSON
";
//定義一則訊息
var Messages = @"
[
{
""type"": ""flex"",
""altText"": ""This is a Flex Message"",
""contents"": $flex$
}
]
";
//發送
bot.PushMessageWithJSON(
AdminUserId,
Messages.Replace("$flex$", flexContents));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment