KaiheilaSharp.Web.Webhook 1.0.1

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package KaiheilaSharp.Web.Webhook --version 1.0.1
NuGet\Install-Package KaiheilaSharp.Web.Webhook -Version 1.0.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="KaiheilaSharp.Web.Webhook" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KaiheilaSharp.Web.Webhook --version 1.0.1
#r "nuget: KaiheilaSharp.Web.Webhook, 1.0.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.
// Install KaiheilaSharp.Web.Webhook as a Cake Addin
#addin nuget:?package=KaiheilaSharp.Web.Webhook&version=1.0.1

// Install KaiheilaSharp.Web.Webhook as a Cake Tool
#tool nuget:?package=KaiheilaSharp.Web.Webhook&version=1.0.1

KaiheilaSharp.Web.Webhook

开黑啦机器人 Webhook 连接库。支持直接 Webhook 连接和通过 kaiheila/krust 进行 Websocket 转发后的消息。

若进行直接的 Webhook 连接,建议使用 Nginx 等 Web 服务器进行反向代理和配置 SSL 访问。

若使用 Websocket 转发消息,请不要将端口暴露至公网。

// 创建一个 Webhook 实例,传入参数为 API 路径,监听 IP 地址,监听端口
// 监听 IP 地址和监听端口为可选参数,不传入则使用默认值 127.0.0.1:5000
// 你可以在 WithWebApplicationConfiguration() 方法中进行进一步配置
// WithWebApplicationConfiguration() 中的配置将会覆盖构造函数中的配置
var webhook = new Webhook("/", IPAddress.Loopback, 5000)
    .WithEncryptKey("你的加密字符串,留空为无加密模式")
    .WithVerifyToken("你的验证密钥")
    .WithWebApplicationConfiguration(builder =>
    {
        // 在此处进行 WebApplication 的配置
        
        // 如果你使用 Serilog,可以在此处进行配置
        // 默认情况下若不进行 Logger 的配置,将不会有日志输出
        builder.Host.UseSerilog();
    })
    // 配置 Event 事件,可以多个串起来
    .Subscribe(message =>
    {
        Log.Logger.Information(message);
    })
    .Subscribe(message =>
    {
        Console.WriteLine(message);
    });

// 运行
await webhook.Run();
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.
  • net6.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