HoshikawaKaguya.Sora.Command
2.3.0
Prefix Reserved
dotnet add package HoshikawaKaguya.Sora.Command --version 2.3.0
NuGet\Install-Package HoshikawaKaguya.Sora.Command -Version 2.3.0
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="HoshikawaKaguya.Sora.Command" Version="2.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HoshikawaKaguya.Sora.Command" Version="2.3.0" />
<PackageReference Include="HoshikawaKaguya.Sora.Command" />
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 HoshikawaKaguya.Sora.Command --version 2.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HoshikawaKaguya.Sora.Command, 2.3.0"
#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 HoshikawaKaguya.Sora.Command@2.3.0
#: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=HoshikawaKaguya.Sora.Command&version=2.3.0
#tool nuget:?package=HoshikawaKaguya.Sora.Command&version=2.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Sora
一个基于 C#/.NET 10 的多协议异步机器人开发框架
特性
- 协议适配:Milky(维护中);OneBot v11 适配器已废弃并停止维护
- 模块化架构
- 属性指令路由(
[CommandGroup]+[Command]) - 事件管线过滤器(前置/命令/后置)
- 完整的事件分发与消息等待机制
- 简单直接的 API 设计
安装
dotnet add package HoshikawaKaguya.Sora
dotnet add package HoshikawaKaguya.Sora.Adapter.Milky # Milky 协议
快速开始
using Sora;
using Sora.Adapter.Milky;
SoraService service = SoraServiceFactory.Instance.CreateMilkyService(
new MilkyConfig
{
Host = "localhost",
Port = 3010,
AccessToken = "your-token"
});
service.Events.OnMessageReceived += async e =>
{
if (e.Message.Body.GetText() == "ping")
await e.Api.SendGroupMessageAsync(e.Message.GroupId, new MessageBody("pong"));
};
await service.StartAsync();
await Task.Delay(-1);
项目模块
| 包 | 说明 |
|---|---|
HoshikawaKaguya.Sora |
框架应用层 |
HoshikawaKaguya.Sora.Entities |
共享实体 — 事件、消息段、API 接口 |
HoshikawaKaguya.Sora.Core |
核心工具库 |
HoshikawaKaguya.Sora.Command |
属性指令路由 |
HoshikawaKaguya.Sora.Adapter.Milky |
Milky 协议适配器 |
HoshikawaKaguya.Sora.Adapter.OneBot11 |
OneBot v11 协议适配器(支持截至 Sora 2.2) |
HoshikawaKaguya.Sora.Adapter.OneBot11 的支持范围截至 Sora 2.2;后续版本停止维护,并退出构建、测试和发布。源码、专属测试和示例仅作历史参考,使用
OB11 的项目应固定在 Sora 2.2 或迁移到 Milky。
文档与链接
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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.
-
net10.0
- HoshikawaKaguya.Sora.Core (>= 2.3.0)
- HoshikawaKaguya.Sora.Entities (>= 2.3.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on HoshikawaKaguya.Sora.Command:
| Package | Downloads |
|---|---|
|
HoshikawaKaguya.Sora
.NET 10 多协议异步机器人开发框架 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.3.0 | 112 | 9/11/2026 |
| 2.3.0-g47336a5138 | 96 | 9/11/2026 |
| 2.2.0 | 114 | 9/11/2026 |
| 2.2.0-g41c24bb265 | 117 | 9/11/2026 |
| 2.1.2 | 132 | 9/8/2026 |
| 2.1.2-gff090182ed | 126 | 9/9/2026 |
| 2.1.2-g1a4d4fb064 | 92 | 9/9/2026 |
| 2.1.1-g18d33eba96 | 121 | 9/8/2026 |
| 2.0.5 | 309 | 4/29/2026 |
| 2.0.4 | 106 | 4/29/2026 |
| 2.0.3 | 158 | 4/12/2026 |