Skip to content

Commit

Permalink
Bumps version into v0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gehongyan committed Aug 30, 2024
1 parent 8d66ccf commit 7a0fa0f
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 5 deletions.
101 changes: 97 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,95 @@

---

## v0.9.0 [2024-08-30]

## Update Roadmap

This update introduces the following new packages:

- `Kook.Net.Webhook`: Webhook support package
- `Kook.Net.Webhook.HttpListener`: Webhook implementation package for HTTP Listener
- `Kook.Net.Webhook.AspNet`: Webhook implementation package integrated with ASP.NET
- `Kook.Net.MessageQueue.InMemory`: In-memory message queue support package
- `Kook.Net.MessageQueue.MassTransit`: MassTransit message queue support package
- `Kook.Net.DependencyInjection.Microsoft`: Dependency injection extension package for
Microsoft.Extensions.DependencyInjection
- `Kook.Net.Hosting`: Hosting service extension package

The `Kook.Net` package now references the `Kook.Net.Webhook` package and has removed the reference to the
`Kook.Net.CardMarkup` package. If you need to continue using the functionality for building card messages via markup
language, please reference the `Kook.Net.CardMarkup` package separately.

Voice connection and streaming features have been changed to be implemented by an officially supported method. The newly
added API for receiving voice data streams is experimental and not officially supported.

The exception thrown by `Emote.Parse` when an error occurs has been changed from `ArgumentException` to
`FormatException`. The return result of `Emote.ToString` has been changed to be equivalent to the result of
`ToKMarkdownString`. The link format provided by `MessageExtensions.GetJumpUrl` has been adjusted.
`SocketGuild.ValidBoostSubscriptions` has been changed to `SocketGuild.ActiveBoostSubscriptions`. `Tag<T>` has been
changed to `Tag<TKey, TValue>`.

### Added

- Added support for custom message queues, with the default implementation being synchronous message processing. Support
for setting the message queue provider by installing extension NuGet packages and configuring
`KookSocketConfig.MessageQueueProvider`. `Kook.Net.MessageQueue.InMemory` is the in-memory queue support package, and
`Kook.Net.MessageQueue.MassTransit` is the MassTransit queue support package. Refer to the examples for usage.
- Added support for Webhook mode, which is currently implemented based on the Socket implementation. The Webhook
integrated by Kook.Net is the abstract class `KookWebhookClient`. `Kook.Net.Webhook.HttpListener` is the Webhook
implementation package for HTTP Listener, and `Kook.Net.Webhook.AspNet` is the Webhook implementation package
integrated with ASP.NET. Refer to the examples for usage.
- Added extension methods package for the Microsoft.Extensions.DependencyInjection dependency injection framework
`Kook.Net.DependencyInjection.Microsoft`, to support quick addition of various clients from Kook.Net, refer to the
examples for usage.
- Added hosting service extension package based on `IHost` and `IHostedService` `Kook.Net.Hosting`, to support quick
addition of various clients from Kook.Net as hosting services, refer to the examples for usage.
- Added support for receiving voice data stream related APIs. (Experimental feature, not officially supported)
- The text command framework has added built-in support for parameter parsing of `DateOnly` and `TimeOnly` types, added
support for parameter parsing of `Uri` type, and added command parsing for mixed text-image messages.
- Added extension method `MaybeTextImageMixedMessage` on `IUserMessage` to determine if it might be a mixed text-image
message.
- Made the constructor of `Emote` public.
- Added `KookComparers` class to support KOOK entities comparison by ID.
- Added `Parse` and `TryParse` methods to the `Color` class.
- `IKookClient` provides `LoginAsync` and `LogoutAsync` methods.
- Added `TagUtil` to convert `ITag` to `Tag<TKey, TValue>`.

### Fixed

- Fixed the issue where the `AudioClient.ClientDisconnected` event was not correctly raised.
- Fixed the issue where `IsOwner` on `Rest/SocketGuildUser` could be determined but the value was `null`.
- Fixed the issue where `RequireRoleAttribute` could be incorrectly added to inappropriate targets.
- Fixed the issue where the server member update event threw an exception when the nickname parameter was not carried.
- Fixed the issue where the implementation on `IGuild` did not expose the `IsAvailable` property.
- Fixed the issue where the values of `EveryoneMention` and `HereMention` in `ITag` might be `0` instead of `0U`.

### Changed

- After user code manipulates server member roles via API, the framework will attempt to update the cache to get as
accurate role information as possible without updating user role information via API.
- The exception thrown by `Emote.Parse` when an error occurs has been changed from `ArgumentException` to
`FormatException`.
- The return result of `Emote.ToString` has been changed to be equivalent to the result of `ToKMarkdownString`.
- Voice connection and streaming features have been changed to be implemented by an officially supported method.
- Changed the link format provided by `MessageExtensions.GetJumpUrl`, adjusted the server channel to the newly supported
official link format, and adjusted the parameters in private chat channels to use chat codes.
- Changed `Tag<T>` to `Tag<TKey, TValue>`.
- Adjusted the result of `IUserMessage.Resolve` to be more in line with the KMarkdown format.
- Renamed the first parameter on `ModuleBase.ReplyTextAsync` to `text`.
- Renamed `SocketGuild.ValidBoostSubscriptions` to `SocketGuild.ActiveBoostSubscriptions`.
- The `Kook.Net` package no longer includes a reference to `Kook.Net.CardMarkup`.

### Removed

- Due to the deactivation of many unofficial interfaces, most APIs on Kook.Net.Experimental have been removed.

### Misc

- XML documentation has been rewritten in Simplified Chinese.
- Added usage examples for MessageQueue, Webhook, and OAuth.
- Added Simplified Chinese README.

## v0.8.0 [2024-05-28]

### Update Roadmap
Expand Down Expand Up @@ -114,7 +203,8 @@ It's important to note that, due to limitations in the KOOK API, fetching messag
supported within voice channels. Therefore, calling `GetMessagesAsync` and `GetPinnedMessagesAsync` methods from
`IMessageChannel` on voice channels is not supported.

Additionally, while voice channels support operations on `Topic` and `SlowModeInterval` at the API level, the KOOK client
Additionally, while voice channels support operations on `Topic` and `SlowModeInterval` at the API level, the KOOK
client
currently does not reflect these capabilities.

Creating channels does not immediately support specifying a Topic. The `Topic` property in `CreateTextChannelProperties`
Expand Down Expand Up @@ -147,17 +237,20 @@ creation.

### Update Roadmap

In KOOK, mentioning voice channels in text messages is not supported, meaning `IVoiceChannel` should not be derived from `IMentionable` interface. Incorrect usage of mentioning `IVoiceChannel` should be removed or modified.
In KOOK, mentioning voice channels in text messages is not supported, meaning `IVoiceChannel` should not be derived from
`IMentionable` interface. Incorrect usage of mentioning `IVoiceChannel` should be removed or modified.

The name of the cancellation token has been changed from `CancelToken` to `CancellationToken`. Existing methods, variables, properties, and parameters related to cancellation token should be updated.
The name of the cancellation token has been changed from `CancelToken` to `CancellationToken`. Existing methods,
variables, properties, and parameters related to cancellation token should be updated.

### Added

- Added connection and streaming for voice channels.

### Fixed

- Fixed an issue where `KookSocketClient` did not correctly handle `ConnectionState` when casted to `IKookClient` or `BaseKookClient`.
- Fixed an issue where `KookSocketClient` did not correctly handle `ConnectionState` when casted to `IKookClient` or
`BaseKookClient`.

### Changes

Expand Down
2 changes: 1 addition & 1 deletion Kook.Net.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<VersionPrefix>0.9.0</VersionPrefix>
<VersionSuffix>beta5</VersionSuffix>
<!-- <VersionSuffix>beta5</VersionSuffix>-->
<IsPackable>false</IsPackable>
<IsTrimmable>false</IsTrimmable>
<IsAotCompatible>false</IsAotCompatible>
Expand Down
67 changes: 67 additions & 0 deletions docs/changelog/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,73 @@ title: 变更日志

# 变更日志

## v0.9.0 [2024-08-30]

### 更新路线

本次更新增加了以下新的软件包:

- `Kook.Net.Webhook`:Webhook 支持包
- `Kook.Net.Webhook.HttpListener`:HTTP Listener 的 Webhook 实现包
- `Kook.Net.Webhook.AspNet`:与 ASP.NET 集成的 Webhook 实现包
- `Kook.Net.MessageQueue.InMemory`:内存消息队列支持包
- `Kook.Net.MessageQueue.MassTransit`:MassTransit 消息队列支持包
- `Kook.Net.DependencyInjection.Microsoft`:Microsoft.Extensions.DependencyInjection 依赖注入扩展包
- `Kook.Net.Hosting`:主机服务扩展包

`Kook.Net` 包新增了对 `Kook.Net.Webhook` 包的引用,移除了对 `Kook.Net.CardMarkup` 包的引用,如需继续使用有关通过标记语言构建卡片消息的功能,请单独引用 `Kook.Net.CardMarkup` 包。

语音连接与推流功能已变更为由受官方支持的方式实现,新增的接收语音数据流相关的 API 为实验性功能,不受官方支持。

`Emote.Parse` 在发生错误时会引发的异常从 `ArgumentException` 变更为 `FormatException``Emote.ToString` 的返回结果变更为等效于 `ToKMarkdownString` 的结果。`MessageExtensions.GetJumpUrl` 所提供的链接格式进行了调整。`SocketGuild.ValidBoostSubscriptions` 变更为 `SocketGuild.ActiveBoostSubscriptions``Tag<T>` 变更为 `Tag<TKey, TValue>`

### 新增

- 新增支持自定义消息队列,默认实现为同步消息处理,支持通过安装扩展 NuGet 包并配置 `KookSocketConfig.MessageQueueProvider` 来设置消息队列提供者。`Kook.Net.MessageQueue.InMemory` 为内存队列支持包,`Kook.Net.MessageQueue.MassTransit` 为 MassTransit 队列支持包。用法请参考示例。
- 新增支持 Webhook 模式,目前所实现的 Webhook 模式建立在 Socket 实现之上,Kook.Net 所集成的 Webhook 为抽象类 `KookWebhookClient``Kook.Net.Webhook.HttpListener` 为 HTTP Listener 的 Webhook 实现包,`Kook.Net.Webhook.AspNet` 为与 ASP.NET 集成的 Webhook 实现包。用法请参考示例。
- 新增对 Microsoft.Extensions.DependencyInjection 依赖注入框架的扩展方法包 `Kook.Net.DependencyInjection.Microsoft`,用于支持快捷添加 Kook.Net 中各种客户端的服务,用法请参考示例。
- 新增基于 `IHost``IHostedService` 扩展的主机服务扩展包 `Kook.Net.Hosting`,用于支持快捷添加 Kook.Net 中各种客户端的主机服务,用法请参考示例。
- 新增支持接收语音数据流相关的 API。(实验性功能,不受官方支持)
- 文本命令框架新增内置支持对 `DateOnly``TimeOnly` 类型的参数解析,新增支持对 `Uri` 类型的参数解析,新增对图文混排消息的命令解析。
- `IUserMessage` 上新增扩展方法 `MaybeTextImageMixedMessage`,用于判断是否可能为图文混排消息。
- 公开 `Emote` 的构造函数。
- 新增 `KookComparers` 类,用于支持 KOOK 实体按 ID 比较。
- 新增 `Color` 上的 `Parse``TryParse` 方法。
- `IKookClient` 提供 `LoginAsync``LogoutAsync` 方法。
- 新增 `TagUtil`,用于转换 `ITag``Tag<TKey, TValue>`

### 修复

- 修复 `AudioClient.ClientDisconnected` 事件未能被正确引发的问题。
- 修复 `Rest/SocketGuildUser``IsOwner` 可以被确定但值为 `null` 的问题。
- 修复 `RequireRoleAttribute` 可以被错误地添加到不恰当的目标的问题。
- 修复服务器成员更新事件未携带昵称参数时引发异常的问题。
- 修复 `IGuild` 上的实现未公开 `IsAvailable` 属性的问题。
- 修复 `ITag` 中的 `EveryoneMention``HereMention` 的值可能为 `0` 而非 `0U` 的问题。

### 变更

- 用户代码通过 API 操作服务器成员的角色后,框架会尝试更新缓存,以在不通过 API 更新用户角色信息时,可以通过缓存获得尽量准确的角色信息。
- `Emote.Parse` 在发生错误时会引发的异常从 `ArgumentException` 变更为 `FormatException`
- `Emote.ToString` 的返回结果变更为等效于 `ToKMarkdownString` 的结果。
- 语音连接与推流功能已变更为由受官方支持的方式实现。
- 变更 `MessageExtensions.GetJumpUrl` 所提供的链接格式,服务器频道更改为官方新增支持的链接格式,私聊频道中的参数调整为使用聊天代码。
- 变更 `Tag<T>``Tag<TKey, TValue>`
- 调整 `IUserMessage.Resolve` 的结果,使其更符合 KMarkdown 的格式。
- `ModuleBase.ReplyTextAsync` 上的第一个参数重命名为 `text`
- 重命名 `SocketGuild.ValidBoostSubscriptions``SocketGuild.ActiveBoostSubscriptions`
- `Kook.Net` 包不再包含对 `Kook.Net.CardMarkup` 的引用。

### 移除

- 由于大量非官方接口已被禁用,Kook.Net.Experimental 上的大部分 API 均已移除。

### 其它

- XML 文档已重写为简体中文。
- 新增 MessageQueue、Webhook、OAuth 的用法示例。
- 新增简体中文 README。

## v0.8.0 [2024-05-28]

### 更新路线
Expand Down

0 comments on commit 7a0fa0f

Please sign in to comment.