LineDevelopers 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package LineDevelopers --version 1.0.3                
NuGet\Install-Package LineDevelopers -Version 1.0.3                
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="LineDevelopers" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LineDevelopers --version 1.0.3                
#r "nuget: LineDevelopers, 1.0.3"                
#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 LineDevelopers as a Cake Addin
#addin nuget:?package=LineDevelopers&version=1.0.3

// Install LineDevelopers as a Cake Tool
#tool nuget:?package=LineDevelopers&version=1.0.3                

dotnet version

LINE Developers.Net

이 라이브러리는 LINE Developers의 API를 C# 라이브러리로 개발한 것이며, LINE Developers와 관련없는 비공식 라이브러리 임을 밝힙니다. 한국에서는 지원하지 않거나 유료 기반의 기능들은 테스트를 완료하지 못했습니다. 참고하시기 바라며 LINE Messenger 기반 메시지 발송 또는 챗봇을 개발하시는 분들께 도움이 되길 바랍니다.

1. 사용 가이드 문서

  1. Nuget을 통한 설치
  • Nuget
    Install-Package LineDevelopers 
    
  1. 메시지 생성 및 발송 가이드
  2. webhook quick start

2. 라이브러리 소개

2-1. LineChannelAccessTokenClient class

using Line;

using (var client = new LineChannelAccessTokenClient())
{
    try
    {
        var result = await client.IssueShortLivedChannelAccessTokenAsync("client id", "secret");

        await client.VerifyShortLonglivedChannelAccessTokenAsync(result.AccessToken);
    }
    catch (LineCredentialException ex)
    {
        Console.WriteLine($"error : {ex.Message}");
        Console.WriteLine($"error_description : {ex.Detail}");
    }
}
LINE Developers Methods Tested
Issue channel access token v2.1 IssueChannelAccessTokenAsync
Verify the validity of the channel access token v2.1 VerifyChannelAccessTokenAsync
Get all valid channel access token key IDs v2.1 GetAllValidChannelAccessTokenKeyIDsAsync
Revoke channel access token v2.1 RevokeChannelAccessTokenAsync
Issue short-lived channel access token IssueShortLivedChannelAccessTokenAsync
Verify the validity of short-lived and long-lived channel access tokens VerifyShortLonglivedChannelAccessTokenAsync
Revoke short-lived or long-lived channel access token RevokeShortLongLivedChannelAccessTokenAsync

2-2. LineMessagingClient class

각 기능 별로 개별 class들이 아래와 같이 존재합니다. 하지만 LineMessagingClient를 통해 아래의 모든 기능들을 사용 할 수 있으며 LineMessagingClient를 통해 구현하는 것을 권장합니다.

  • 예시)
    using Line.Message;
    
    using (var client = new LineMessagingClient("your access token"))
    {
        await client.Message.SendBroadcastMessageAsync(new TextMessage("hello world"));
        await client.Message.SendReplyMessageAsync("reply token", new TextMessage("hello world"));
        await client.Insight.GetNumberOfMessageDeliveriesAsync(new DateOnly(2022, 10, 31));
        await client.RichMenu.DownloadRichMenuImageAsync("test richmenu id", @"c:\temp\test.jpg");
    }
    

2-2-1. LineMessageClient class

LINE Developers Methods Tested
Send reply message SendReplyMessageAsync
Send push message SendPushMessageAsync
Send multicast message SendMulticastMessageAsync
Send narrowcast message SendNarrowcastMessageAsync
Send broadcast message SendBroadcastMessageAsync
Get the target limit for sending messages this month GetTheTargetLimitForSendingMessagesThisMonthAsync
Get number of messages sent this month GetNumberOfMessagesSentThisMonthAsync
Get number of sent reply messages GetNumberOfSentMessagesAsync
Get number of sent push messages GetNumberOfSentMessagesAsync
Get number of sent multicast messages GetNumberOfSentMessagesAsync
Get number of sent broadcast messages GetNumberOfSentMessagesAsync
Validate message objects of a reply message ValidateMessageObjectsOfMessageAsync
Validate message objects of a push message ValidateMessageObjectsOfMessageAsync
Validate message objects of a multicast message ValidateMessageObjectsOfMessageAsync
Validate message objects of a narrowcast message ValidateMessageObjectsOfMessageAsync
Validate message objects of a broadcast message ValidateMessageObjectsOfMessageAsync
Get number of units used this month GetNumberOfUnitsUsedThisMonthAsync
Get name list of units used this month GetNameListOfUnitsUsedThisMonthAsync

2-2-2. LineInsightClient class

LINE Developers Methods Tested
Get number of message deliveries GetNumberOfMessageDeliveriesAsync
Get number of followers GetNumberOfFollowersAsync
Get friend demographics GetFriendsDemographicsAsync
Get user interaction statistics GetUserInteractionStatisticsAsync
Get statistics per unit GetStatisticsPerUnitAsync

2-2-3. LineRichMenuClient class

LINE Developers Methods Tested
Create rich menu CreateRichMenuAsync
Validate rich menu object ValidateRichMenuAsync
Upload rich menu image UploadRichMenuImageAsync
Download rich menu image DownloadRichMenuImageAsync
Get rich menu list GetRichMenuListAsync
Get rich menu GetRichMenuAsync
Delete rich menu DeleteRichMenuAsync
Set default rich menu SetDefaultRichMenuAsync
Get default rich menu ID GetDefaultRichMenuIdAsync
Cancel default rich menu CancelDefaultRichMenuAsync
Create rich menu alias CreateRichMenuAliasAsync
Delete rich menu alias DeleteRichMenuAliasAsync
Update rich menu alias UpdateRichMenuAliasAsync
Get rich menu alias information GetRichMenuAliasInformationAsync
Get list of rich menu alias GetListOfRichMenuAliasAsync
Link rich menu to user LinkRichMenuToUserAsync
Link rich menu to multiple users LinkRichMenuToMultipleUsersAsync
Get rich menu ID of user GetRichMenuIdOfUserAsync
Unlink rich menu from user UnlinkRichMenuFromUserAsync
Unlink rich menus from multiple users UnlinkRichMenusFromMultipleUsersAsync
Replace or unlink the linked rich menus in batches ReplaceOrUnlinkTheLinkedRichMenusInBatchesAsync
Get the status of rich menu batch control GetStatusOfRichMenuBatchControlAsync
Validate a request of rich menu batch control ValidateRequestOfRichMenuBatchControlAsync

2-2-4. LineGroupChatClient class

LINE Developers Methods Tested
Get group chat summary GetSummaryAsync
Get number of users in a group chat GetNumberOfUsersAsync
Get group chat member user IDs GetMemberUserIdsAsync
Get group chat member profile GetChatMemberProfileAsync
Leave group chat LeaveAsync

2-2-5. LineMultiPersonChatClient class

LINE Developers Methods Tested
Get number of users in a multi-person chat GetNumberOfUsersAsync
Get multi-person chat member user IDs GetMemberUserIdsAsync
Get multi-person chat member profile GetMemberProfileAsync
Leave multi-person chat LeaveAsync

2-2-6. LineUserClient class

LINE Developers Methods Tested
Get profile GetUserProfileAsync
Get a list of users who added your LINE Official Account as a friend GetFollowersAsync

2-2-7. LineAccountLinkClient class

LINE Developers Methods Tested
Issue link token IssueLinkTokenAsync

2-2-8. LineWebhookSettingClient class

LINE Developers Methods Tested
Set webhook endpoint URL SetEndpointUrlAsync
Get webhook endpoint information GetEndpointInformationAsync
Test webhook endpoint TestEndpointAsync

2-2-9. LineBotClient class

LINE Developers Methods Tested
Get bot info GetBotInformationAsync

2-3 LineLiffClient class

using Line;
using Line.Liff;

using (var client = new LineLiffClient("access token"))
{
    try
    {
        var liffs = await client.GetAllLiffAppsAsync();

        foreach (var liff in liffs)
        {
            await client.DeleteLiffAppsFromChannelAsync(liff.LiffId);
        }
    }
    catch (LineException ex)
    {
        Console.WriteLine(ex.Message);

        foreach (var detail in ex.Details ?? Enumerable.Empty<Detail>())
        {
            Console.WriteLine(detail.Message);
            Console.WriteLine(detail.Property);
        }
    }
}
LINE Developers Methods Tested
Adding the LIFF app to a channel AddLiffAppToChannelAsync
Update LIFF app settings UpdateLiffAppSettingAsync
Get all LIFF apps GetAllLiffAppsAsync
Delete LIFF app from a channel DeleteLiffAppsFromChannelAsync

3. 참고 문서

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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.
  • net7.0

    • No dependencies.

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.1.20 211 8/1/2023
1.1.10 163 7/27/2023
1.1.0 187 7/21/2023
1.0.3 164 7/17/2023