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.
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
取得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 | Versions 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.
-
net6.0
- Newtonsoft.Json (>= 13.0.1)
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 |
---|---|---|
8.0.0 | 0 | 11/25/2024 |
1.0.0 | 216 | 7/18/2023 |
0.0.5-alpha | 186 | 1/28/2023 |
0.0.4-alpha | 167 | 12/25/2022 |
0.0.3-alpha | 175 | 11/30/2022 |
0.0.2-alpha | 179 | 11/29/2022 |
0.0.1-alpha | 169 | 11/22/2022 |