DotNetLineBotSDK 0.0.3-alpha

This is a prerelease version of DotNetLineBotSDK.
There is a newer version of this package available.
See the version list below for details.
dotnet add package DotNetLineBotSDK --version 0.0.3-alpha
NuGet\Install-Package DotNetLineBotSDK -Version 0.0.3-alpha
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DotNetLineBotSDK" Version="0.0.3-alpha" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotNetLineBotSDK --version 0.0.3-alpha
#r "nuget: DotNetLineBotSDK, 0.0.3-alpha"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DotNetLineBotSDK as a Cake Addin
#addin nuget:?package=DotNetLineBotSDK&version=0.0.3-alpha&prerelease

// Install DotNetLineBotSDK as a Cake Tool
#tool nuget:?package=DotNetLineBotSDK&version=0.0.3-alpha&prerelease

取得User Message

var req = this.HttpContext.Request;
using (var bodyReader = new StreamReader(stream: req.Body,
    encoding: Encoding.UTF8,
    detectEncodingFromByteOrderMarks: false,
    bufferSize: 1024, leaveOpen: true))

{
    var body = await bodyReader.ReadToEndAsync();
    var lineReceMsg = ReceivedMessageConvert.ReceivedMessage(body);
    if (lineReceMsg != null && lineReceMsg.Events[0].Type == WebhookEventType.message.ToString())
    {
        if (lineReceMsg.Events[0].Message.Type == MessageType.text.ToString())
        {
            // user message text
            lineReceMsg.Events[0].Message.Text;
        }
    }
}

回應文字訊息

var replyEvent = new ReplyEvent(channel_Access_Token);
var txtMessage1 = new TextMessage("reply message");
await replyEvent.ReplyAsync(lineReceMsg.Events[0].ReplyToken,
                           new List<IMessage>() {
                                txtMessage1
                           });

回應文字+表情訊息

var replyEvent = new ReplyEvent(channel_Access_Token);
var txtMessage1 = new TextMessage("$ LINE emoji $")
{
    Emojis = new List<TextMessageEmoji>()
    {
        new TextMessageEmoji(){Index=0,ProductId="5ac1bfd5040ab15980c9b435",EmojiId="002"},
        new TextMessageEmoji(){Index=13,ProductId="5ac1bfd5040ab15980c9b435",EmojiId="008"}
    }
};
var txtMessage2 = new TextMessage("\U0001F449 Unicode emoji \U0001F617");               
await replyEvent.ReplyAsync(lineReceMsg.Events[0].ReplyToken,
                           new List<IMessage>() {
                                txtMessage1, txtMessage2
                           });

回應圖片訊息

var imgMessage = new ImageMessage("{Image URL}"
, "{Preview image URL}");

await replyEvent.ReplyAsync(lineReceMsg.Events[0].ReplyToken,
                            new List<IMessage>() {
                                imgMessage
                            });

回應表情訊息

var stickerMessage1 = new StickerMessage(6325, 10979907);
var stickerMessage2 = new StickerMessage(1070, 17843);

await replyEvent.ReplyAsync(lineReceMsg.Events[0].ReplyToken,
                            new List<IMessage>() {
                                stickerMessage1,stickerMessage2
                            });

回應地點訊息

var locMessage = new LocationMessage("title", "address", 22.63434293546932m, 120.3024596345037m);

await replyEvent.ReplyAsync(lineReceMsg.Events[0].ReplyToken,
    new List<IMessage>() {
        locMessage
    });

回應影片訊息

var videoMessage = new VideoMessage("{mp4 video URL}", "{Preview image URL}");
await replyEvent.ReplyAsync(lineReceMsg.Events[0].ReplyToken,
    new List<IMessage>() {
        videoMessage
    });

回應音訊訊息

var audioMessage = new AudioMessage("{m4a audio URL}", "{ Length of audio file (milliseconds) }");
await replyEvent.ReplyAsync(lineReceMsg.Events[0].ReplyToken,
    new List<IMessage>() {
        audioMessage
    });
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 152 7/18/2023
0.0.5-alpha 148 1/28/2023
0.0.4-alpha 141 12/25/2022
0.0.3-alpha 152 11/30/2022
0.0.2-alpha 152 11/29/2022
0.0.1-alpha 146 11/22/2022