Lagrange.Core 0.3.1

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Lagrange.Core --version 0.3.1
                    
NuGet\Install-Package Lagrange.Core -Version 0.3.1
                    
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="Lagrange.Core" Version="0.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lagrange.Core" Version="0.3.1" />
                    
Directory.Packages.props
<PackageReference Include="Lagrange.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lagrange.Core --version 0.3.1
                    
#r "nuget: Lagrange.Core, 0.3.1"
                    
#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.
#:package Lagrange.Core@0.3.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lagrange.Core&version=0.3.1
                    
Install as a Cake Addin
#tool nuget:?package=Lagrange.Core&version=0.3.1
                    
Install as a Cake Tool

<div align="center">

Lagrange.Core Core OneBot C# C#

License Telegram

Image

> English < | 简体中文

</div>

<table> <tr> <td><a href="https://github.com/LagrangeDev/Lagrange.Core">Lagrange.Core</a></td> <td>NTQQ Protocol Implementation(👈Here</td> </tr> <tr> <td><a href="https://github.com/whitechi73/OpenShamrock">OpenShamrock</a></td> <td>Based on Xposed, OneBot Bot Framework</td> </tr> <tr> <td><a href="https://github.com/chrononeko/chronocat">Chronocat</a></td> <td>Based on Electron, modular Satori Bot Framework</td> </tr> </table>

Document

Lagrange.Doc

Docker guide

Out of Active Feature Requesting

Lagrange.Core has completed nearly all the function and task scheduled by Linwenxuan05, so mostly enhance to the library would be concentrated to the repo for next.

Feature request would be accepted but implemented with a long duration.

The new function of NTQQ supported in following versions would be added as well.

Disclaimer

The Lagrange.Core project, including its developers, contributors, and affiliated individuals or entities, hereby explicitly disclaim any association with, support for, or endorsement of any form of illegal behavior. This disclaimer extends to any use or application of the Lagrange.Core project that may be contrary to local, national, or international laws, regulations, or ethical guidelines.

Lagrange.Core is an open-source software project designed to facilitate lawful and ethical applications in its intended use cases. It is the responsibility of each user to ensure that their usage of Lagrange.Core complies with all applicable laws and regulations in their jurisdiction.

The developers and contributors of Lagrange.Core assume no liability whatsoever for any actions taken by users that violate the law or engage in any form of illicit activity. Users are solely responsible for their own actions and any consequences that may arise from the use of Lagrange.Core.

Furthermore, any discussions, suggestions, or guidance provided by the Lagrange.Core community, including its developers, contributors, and users, should not be interpreted as legal advice. It is strongly recommended that users seek independent legal counsel to understand the legal implications of their actions and ensure compliance with the relevant laws and regulations.

By using or accessing Lagrange.Core, the user acknowledges and agrees to release the developers, contributors, and affiliated individuals or entities from any and all liability arising from the use or misuse of the project, including any legal consequences incurred as a result of their actions.

Please use Lagrange.Core responsibly and in accordance with the law.

SignServer

https://sign.lagrangecore.org/api/sign

Thanks for 外国热心网友 for Provision of Azure Servlet

** Built-in SignServer is now provided, Enjoy! **

Features List

Protocol Support Login Support Messages Support Operations Support Events Support
Windows 🟢 QrCode 🟢 Images 🟢 Poke 🟢 Captcha 🟢
macOS 🟢 Password 🟢 Text / At 🟢 Recall 🟢 BotOnline 🟢
Linux 🟢 EasyLogin 🟢 Records 🟢 Leave Group 🟢 BotOffline 🟢
UnusalDevice<br/>Password 🔴 QFace 🟢 Set Special Title 🟢 Message 🟢
UnusalDevice<br/>Easy 🟢 Json 🟢 Kick Member 🟢 Poke 🟢
NewDeviceVerify 🟢 Xml 🟢 Mute Member 🟢 MessageRecall 🟢
Forward 🟢 Set Admin 🟢 GroupMemberDecrease 🟢
Video 🟢 Friend Request 🟢 GroupMemberIncrease 🟢
Reply 🟢 Group Request 🟢 GroupPromoteAdmin 🟢
File 🟢 Voice Call 🔴 GroupInvite 🟢
Poke 🟢 Client Key 🟢 GroupRequestJoin 🟢
LightApp 🟢 Cookies 🟢 FriendRequest 🟢
Send Message 🟢 FriendTyping 🔴
FriendVoiceCall 🔴

Lagrange.OneBot

The Binary for development could be found in Actions Artifacts

<Details> <Summary>Message Segement</Summary>

Message Segement Support
Text 🟢
Face 🟢
Image 🟢
Record 🟢
Video 🟢
At 🟢
Rps 🟢
Dice 🟢
Shake 🔴
Poke 🟢
Anonymous 🔴
Share 🔴
Contact 🔴
Location 🟢
Music 🟢
Reply 🟢
Forward 🟢
Node 🟢
Xml 🔴
Json 🟢

</Details>

<Details> <Summary>API</Summary>

API Support
/send_private_msg 🟢
/send_group_msg 🟢
/send_msg 🟢
/delete_msg 🟢
/get_msg 🟢
/get_forward_msg 🟢
/send_like 🟢
/set_group_kick 🟢
/set_group_ban 🟢
/set_group_anonymous_ban 🔴
/set_group_whole_ban 🟢
/set_group_admin 🟢
/set_group_anonymous 🔴
/set_group_card 🟢
/set_group_name 🟢
/set_group_leave 🟢
/set_group_special_title 🟢
/set_friend_add_request 🟢
/set_group_add_request 🟢
/get_login_info 🟢
/get_stranger_info 🟢
/get_friend_list 🟢
/get_group_info 🟢
/get_group_list 🟢
/get_group_member_info 🟢
/get_group_member_list 🟢
/get_group_honor_info 🟢
/get_cookies 🟢
/get_csrf_token 🟢
/get_credentials 🟢
/get_record 🔴
/get_image 🔴
/can_send_image 🟢
/can_send_record 🟢
/get_status 🟢
/get_version_info 🟢
/set_restart 🟢
/clean_cache 🔴

</Details>

<Details> <Summary>Event</Summary>

PostType EventName Support
Message Private Message 🟢
Message Group Message 🟢
Notice Group File Upload 🟢
Notice Group Admin Change 🟢
Notice Group Member Decrease 🟢
Notice Group Member Increase 🟢
Notice Group Mute 🟢
Notice Friend Add 🟢
Notice Group Recall Message 🟢
Notice Friend Recall Message 🟢
Notice Group Poke 🟢
Notice Group red envelope luck king 🔴
Notice Group Member Honor Changed 🔴
Request Add Friend Request 🟢
Request Group Request/Invitations 🟢
Meta LifeCycle 🟢
Meta Heartbeat 🟢

</Details>

<Details> <Summary>Communication</Summary>

CommunicationType Support
Http 🟢
Http-Post 🟢
ForwardWebSocket 🟢
ReverseWebSocket 🟢

</Details>

appsettings.json Example

As the Password is empty here, this indicates that QRCode login is used

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "SignServerUrl": "",
  "Account": {
    "Uin": 0,
    "Password": "",
    "Protocol": "Linux",
    "AutoReconnect": true,
    "GetOptimumServer": true
  },
  "Message": {
    "IgnoreSelf": true,
    "StringPost": false
  },
  "QrCode": {
    "ConsoleCompatibilityMode": false
  },
  "Implementations": [
    {
      "Type": "ReverseWebSocket",
      "Host": "127.0.0.1",
      "Port": 8080,
      "Suffix": "/onebot/v11/ws",
      "ReconnectInterval": 5000,
      "HeartBeatInterval": 5000,
      "HeartBeatEnable": true,
      "AccessToken": ""
    },
    {
      "Type": "ForwardWebSocket",
      "Host": "*",
      "Port": 8081,
      "HeartBeatInterval": 5000,
      "HeartBeatEnable": true,
      "AccessToken": ""
    },
    {
      "Type": "HttpPost",
      "Host": "127.0.0.1",
      "Port": 8082,
      "Suffix": "/",
      "HeartBeatInterval": 5000,
      "HeartBeatEnable": true,
      "AccessToken": ""
    },
    {
      "Type": "Http",
      "Host": "*",
      "Port": 8083,
      "AccessToken": ""
    }
  ]
}

Currently, ForwardWebSocket and Http are implemented based on HttpListener, which has the following problems:

  1. On Linux, the Host header of an Http request must match the value of Prefix unless it is + or *, so configure the Host of ForwardWebSocket and Http to be the domain name or IP you are using to access it.

  2. On Windows, the HttpListener is based on the http.sys implementation, so you need to register urlacl before using it. see netsh. You can also start Lagrange.OneBot using the administrator, at which point HttpListener will automatically register the required urlacl.

NOTICE BEFORE LOGIN

  • The NewDeviceLogin feature has not been implemented yet. It is recommended to use QRCode login for now.
  • Currently, only the signature server implementation for Linux protocol is available. It is recommended to use the Linux protocol.

Known Problem

  • Signature Service is currently not established, so the login tend to be failed and return code may be 45, you can establish your own sign service by rewriting the Signature static class.

Thanks KonataDev/TheSnowfield for Provision of Signature API

Signature API is now not provided, you may need to find it somewhere and inherit SignProvider class for CustomSignProvider in BotConfig

  • Built-in SignServer is now provided, Enjoy!

  • Signature of Windows and macOS is missing, you need to figure out by your self

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Lagrange.Core:

Package Downloads
NoNameBot

A Bot framework based on Lagrange

ALBot.PluginExtension

Plugin extension of ALBot

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.9-beta 209 9/24/2025
2.0.8-beta 254 8/26/2025
2.0.7-beta 233 8/26/2025
2.0.6-beta 230 8/26/2025
2.0.5-beta 192 8/25/2025
2.0.4-beta 173 8/14/2025
2.0.3-beta 169 8/14/2025
2.0.2-beta 288 5/12/2025
2.0.1-beta 167 5/11/2025
2.0.0-beta 162 5/11/2025
2.0.0-bate 169 5/11/2025
0.3.1 2,145 10/6/2024
0.3.0 456 7/25/2024
0.2.3 160 7/25/2024
0.2.2 484 6/11/2024
0.2.1 582 3/19/2024
0.2.0 168 3/18/2024
0.1.17-alpha 163 2/27/2024
0.1.16-alpha 143 2/26/2024
0.1.15-alpha 151 2/26/2024
0.1.14-alpha 156 2/9/2024
0.1.13-alpha 209 1/5/2024
0.1.12-alpha 173 12/23/2023
0.1.11-alpha 154 12/19/2023
0.1.10-alpha 262 11/11/2023
0.1.9-alpha 181 10/29/2023
0.1.8-alpha 184 10/11/2023
0.1.7-alpha 180 10/11/2023
0.1.6-alpha 176 10/8/2023
0.1.5-alpha 165 10/7/2023
0.1.4-alpha 157 9/28/2023
0.1.3-alpha 159 9/23/2023
0.1.2-alpha 178 8/31/2023
0.1.1-alpha 210 8/30/2023
0.1.0-alpha 197 8/27/2023
0.0.9-alpha 194 8/24/2023
0.0.8-alpha 182 8/22/2023
0.0.7-alpha 183 8/20/2023
0.0.6-alpha 209 8/11/2023
0.0.5-alpha 213 8/11/2023
0.0.4-alpha 187 7/29/2023
0.0.3-alpha 200 7/27/2023
0.0.2 199 3/3/2024
0.0.2-alpha 206 7/24/2023
0.0.1-alpha 200 6/29/2023