- Added basic support for thread channels. Introduced the thread channel type
ChannelType.Thread
, and related entitiesIThreadChannel
,RestThreadChannel
,SocketThreadChannel
. Added support for operations to get, create, modify, and delete thread channels. - Added permissions
GuildPermission.ReplyToPost
andChannelPermission.ReplyToPost
to represent the permission to reply to posts, and added support for post channel permissions in methods related to permissions. - Added
SocketRole.Members
, which can be used to retrieve all users with a specified role from the cache.
- Fixed the issue where the
SocketGuildUser.RemoveRolesAsync
method did not respectRequestOptions
. - Fixed the issue where
IChannel.Name
may be null.
- Support sending borderless theme
CardTheme.Invisible
cards DefaultRestClient
supports passing anIWebProxy
instance- Implemented
IEquatable<T>
interface forColor
,AlphaColor
, andGradientColor
- Fixed symbol reference errors in some XML documents
- Fixed issue where attempting to get the message entity from a cacheable object returned by the send message method resulted in null
- Enabled SourceLink
- Fix the issue where the channel creator field being an empty string causes startup failure.
This update introduces the following new packages:
Kook.Net.Webhook
: Webhook support packageKook.Net.Webhook.HttpListener
: Webhook implementation package for HTTP ListenerKook.Net.Webhook.AspNet
: Webhook implementation package integrated with ASP.NETKook.Net.MessageQueue.InMemory
: In-memory message queue support packageKook.Net.MessageQueue.MassTransit
: MassTransit message queue support packageKook.Net.DependencyInjection.Microsoft
: Dependency injection extension package for Microsoft.Extensions.DependencyInjectionKook.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 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, andKook.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, andKook.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
andIHostedService
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
andTimeOnly
types, added support for parameter parsing ofUri
type, and added command parsing for mixed text-image messages. - Added extension method
MaybeTextImageMixedMessage
onIUserMessage
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
andTryParse
methods to theColor
class. IKookClient
providesLoginAsync
andLogoutAsync
methods.- Added
TagUtil
to convertITag
toTag<TKey, TValue>
.
- Fixed the issue where the
AudioClient.ClientDisconnected
event was not correctly raised. - Fixed the issue where
IsOwner
onRest/SocketGuildUser
could be determined but the value wasnull
. - 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 theIsAvailable
property. - Fixed the issue where the values of
EveryoneMention
andHereMention
inITag
might be0
instead of0U
.
- 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 fromArgumentException
toFormatException
. - The return result of
Emote.ToString
has been changed to be equivalent to the result ofToKMarkdownString
. - 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>
toTag<TKey, TValue>
. - Adjusted the result of
IUserMessage.Resolve
to be more in line with the KMarkdown format. - Renamed the first parameter on
ModuleBase.ReplyTextAsync
totext
. - Renamed
SocketGuild.ValidBoostSubscriptions
toSocketGuild.ActiveBoostSubscriptions
. - The
Kook.Net
package no longer includes a reference toKook.Net.CardMarkup
.
- Due to the deactivation of many unofficial interfaces, most APIs on Kook.Net.Experimental have been removed.
- XML documentation has been rewritten in Simplified Chinese.
- Added usage examples for MessageQueue, Webhook, and OAuth.
- Added Simplified Chinese README.
Due to changes in the KOOK API, Bot users can no longer obtain all the necessary basic guild information at startup
through the /guild/index
API. Instead, it is now required to traverse each guild via the /guild/view
API. This change can result in a significantly longer startup time and a large number of API requests for Bots
that have joined many guilds. Therefore, the current version introduces the KookSocketConfig.StartupCacheFetchMode
configuration item, which defines how the Bot loads the basic guild data needed at startup.
Synchronous
: In synchronous mode, after obtaining a simple list of guilds at client startup, the client fetches the basic data of each guild through the API before triggering theReady
event.Asynchronous
: In asynchronous mode, after obtaining a simple list of guilds at client startup, theReady
event is triggered immediately, and a background task is started to fetch all the basic guild data.Lazy
: In lazy mode, after obtaining a simple list of guilds at client startup, theReady
event is triggered immediately without proactively fetching the basic guild data. When events involving the guild are received from the gateway, the guild's basic data will be fetched through the API if it has not already been obtained.Auto
: In automatic mode, the default setting, the client's startup mode is automatically determined based on the number of guilds the Bot has joined. If the number of guilds reachesLargeNumberOfGuildsThreshold
(default is 50), it will beLazy
; if it reachesSmallNumberOfGuildsThreshold
(default is 5), it will beAsynchronous
; otherwise, it will beSynchronous
. This determination is made each time the Bot connects to the WebSocket.
When not using Synchronous
mode, after the Ready
event, accessing cached guild entities might result in entities
that do not fully contain basic guild data. The IsAvailable
property indicates whether the guild entity has fully
cached basic data through the API. In such cases, please proactively call the UpdateAsync
method to update the cached
guild entity through the API. The basic guild data mentioned above mainly includes the guild's channels, roles,
channel permission overrides, and the current user's nickname within guilds.
The entire framework code has been updated to support nullable reference static analysis diagnostics. For the concept of nullable reference types in C#, please refer to Nullable reference types - C# | Microsoft Learn. After updating to the current version, all values that may be null will be marked as nullable types. This may cause some code to generate warnings during compilation, which should be treated as potential null reference exceptions and fixed accordingly.
Additionally, IQuote
has a new implementation MessageReference
, which only contains the ID of the message to be
referenced and is used when calling the API in user code. Existing user code that creates Quote
should migrate
to MessageReference
as soon as possible.
fileName
has been renamed to filename
; the event parameter Cacheable<SocketMessage, Guid>
has been changed
to Cacheable<IMessage, Guid>
; SectionAccessoryMode.Unspecified
is now replaced by null
; Format.StripMarkDown
has
been renamed to StripMarkdown
; and the filename
parameter in the SendFileAsync
overload that accepts the Stream
type is now mandatory. Please note that these changes may cause compilation errors and should be fixed accordingly.
KookSocketConfig
adds theStartupCacheFetchMode
,LargeNumberOfGuildsThreshold
, andSmallNumberOfGuildsThreshold
configuration items to customize how the Bot's Socket client fetches the basic guild data needed at startup via the API.- Two new configuration properties
AutoUpdateRolePositions
andAutoUpdateChannelPositions
have been added toKookSocketConfig
, defaulting tofalse
. When enabled, the client will automatically fetch data via the API upon receiving related events to maintain the cached role and channel sorting information. Embed
addsCardEmbed
.- Card entities and builders now implement
IEquatable<T>
. SocketSelfUser
now implementsIUpdateable
.- Added
IGuild.RecommendInfo.Certifications
. IQuote
has a new implementationMessageReference
, which only contains the ID of the message to be referenced and is used when calling the API in user code.- Support for the event types
embeds_append
,sort_channel
,updated_server_type
,batch_added_channel
,batch_updated_channel
,batch_deleted_channel
,live_status_changed
,PERSON
typedupdated_guild
,add_guild_mute
,delete_guild_mute
,unread_count_changed
has been added, but it is not yet confirmed whether these events will actually be dispatched.
- Fixed the issue where the author of private messages was incorrect.
- Fixed the issue where
SocketUserMessage.Quote.Author
could be null. - Fixed the issue where Tags were missing corresponding values when referencing nonexistent entities in messages.
- Fixed the issue where the voice client failed to handle undefined events, causing stream crashes.
- Fixed the issue where parsing newly introduced mixed media messages failed.
- Corrected the behavior of updating user nicknames.
- Enabled nullable reference types feature. For the concept of nullable reference types in C#, please refer to Nullable reference types - C# | Microsoft Learn.
- Various validations for the card builder are now deferred to the
Build
call. - The types of properties involving lists in cards have been changed to
IList<T>
. Quote.Empty
and its public constructor have been marked asObsolete
, andMessageReference
should be used instead.fileName
has been renamed tofilename
.- The
filename
parameter in theSendFileAsync
overload that accepts theStream
type is now mandatory. BaseSocketClient._baseConfig
has been renamed toBaseConfig
.- The event parameter
Cacheable<SocketMessage, Guid>
has been changed toCacheable<IMessage, Guid>
to address the issue of entity download failure. SectionAccessoryMode.Unspecified
has been removed; please usenull
instead.Format.StripMarkDown
has been renamed toStripMarkdown
, and the original method has been marked asObsolete
.Format.StripMarkdown
now removes hyphens-
.
- Added a reference to
PolySharp
on .NET 7 and earlier target frameworks to support the implementation of some new features on older frameworks. - Added integration tests for some Socket events.
The KOOK client now supports sending messages within voice channels. As a result, the following APIs have been modified:
CreateVoiceChannelProperties
now inherits fromCreateTextChannelProperties
.ModifyVoiceChannelProperties
now inherits fromModifyTextChannelProperties
.IVoiceChannel
now inherits fromITextChannel
.- The value of
ChannelPermissions.Voice
now includes permissions for text channels. - The
SocketTextChannel.GetMessagesAsync
series of methods are now virtual methods, to be overridden bySocketVoiceChannel
.
It's important to note that, due to limitations in the KOOK API, fetching message history and pinning messages are not
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
currently does not reflect these capabilities.
Creating channels does not immediately support specifying a Topic. The Topic
property in CreateTextChannelProperties
has been removed and does not take effect. Please use the ITextChannel.ModifyAsync
method to modify the channel after
creation.
- Added support for defining card messages via XML.
IVoiceChannel
now inherits fromITextChannel
, with relevant implementations updated.- Added
SentRequest
event toBaseKookClient
. - Added non-null result prompts for parsing card message-related
Try*
methods.
- Corrected the issue with
ConnectionManager
incorrectly updatingState
whenDisconnected
.
- Removed the
Topic
property fromCreateTextChannelProperties
.
- Marked the project as not supporting AOT and assembly trimming.
- Added example project
Kook.Net.Samples.CardMarkup
. - Added documentation for defining card messages via XML.
- Added Logo.
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.
- Added connection and streaming for voice channels.
- Fixed an issue where
KookSocketClient
did not correctly handleConnectionState
when casted toIKookClient
orBaseKookClient
.
IVoiceChannel
no longer derived fromIMentionable
interface.- Renamed the name of methods, variables, properties, and parameters from
CancelToken
toCancellationToken
.
- Updated document template, added example project page, and added voice streaming documentation.
RequireUserAttribute
no longer supports construction via the IUser
parameter; please use IUser.Id
instead.
- Added
RequireRoleAttribute
as a precondition in the text command framework. - Added
Aliases
,Summary
, andRemarks
properties, and optional parameters toCommandAttribute
in the text command framework.
- Fixed an issue where exceptions during data download at Bot startup were not properly outputted to the log.
- Removed the unrealistic constructor on
RequireUserAttribute
that accepted anIUser
parameter.
The set accessibility of the AuthTokenType
and AuthToken
properties in the KookRestApiClient
has been changed to
private. Modifying these properties directly in user code may result in framework runtime exceptions. If you need to log
in with a different authentication on the KOOK gateway, please re-login using LoginAsync
after calling LogoutAsync
.
- Added
HasAnnualBuff
,IsSystemUser
, andNameplates
properties to theIUser
interface. - Added
BackgroundColor
property to theUserTag
. - Added support for parsing interactive emojis.
- Changed the set accessibility of the
AuthTokenType
andAuthToken
properties in theKookRestApiClient
to private.
The IVoiceChannel.ServerUrl
property has been moved to the IAudioChannel
interface.
All usages of this property need to be updated.
- Added voice region properties to the
IAudioChannel
interface. - Added support for modifying voice region properties in the
IVoiceChannel.ModifyAsync
method. - Added parameterized constructors to card, module, and element builders.
- The
IVoiceChannel.ServerUrl
property has been moved to theIAudioChannel
interface. - Removed unintentionally provided public set accessors on some properties.
- Fixed incorrect build validation conditions for
SectionModuleBuild
.
- Replaced the Moq testing mock framework with NSubstitute.
- Added Docker usage examples.
- Added support for targeting .NET 8.
The parameter Action<string>
of the ModifyEmoteNameAsync
method has been changed to string
. All usages of this
method need to be updated.
- Fixed an issue where incorrect comparison of
SocketReaction
caused the reaction cannot be removed from the cached message when a reaction is removed. - Fixed an issue where the Socket client did not correctly send the close code when disconnecting.
- Fixed an issue where the results were incorrect when querying messages after a reference message in
the
GetMessagesAsync
method. - Fixed an issue where the
ModifyEmoteNameAsync
method did not correctly rename guild emotes.
- Completed the quick reference guide.
- Added actual functionality to the sample program
SimpleBot
, which can respond to a simple command, reply with buttons, and respond to button click events. - Added implementation examples for Visual Basic and F#.
- Introduced new methods
SocketGuild.GetCategoryChannel
andRestGuild.GetCategoryChannelAsync
.
- Resolved an issue where the
GetJumpUrl
method was returning incorrect results. - Corrected the value of
KookConfig.MaxMessagesPerBatch
that was not being set correctly. - Fixed the incorrect deserialization of deleted quotes.
- Addressed the problem where the
RequestOptions
parameter ofMoveUsersAsync
was not optional. - Fixed the failure of the
MoveUsersAsync
method. - Fixed an issue where modifying channel permissions immediately after creating them on a
SocketGuildChannel
could result in failure without any error information.
- Optimized the internal implementation of the
GetDirectMessageAsync
method. - Ensured consistent string representation for
langword
in comments.
For the sake of convenience, this version has made adjustments to the parameter types passed in some events
in BaseSocketClient
. Please refer to the appendix at the end of the document for specific changes to event parameters.
Applications involving these events need to be updated accordingly.
The enum values and properties representing key accounts in GuildFeature
and GuildFeatures
have been renamed
for more accurate naming. GuildPermissions
has been refactored as a struct, and the type of
the RoleProperties.Permissions
property has been changed accordingly. The type of RestGuild.Channels
was incorrectly
declared as a dictionary with values of type RestChannel
, and has been corrected to a dictionary with values of
type RestGuildChannel
. The return type of some methods on KookSocketClient
was previously ValueTask
, but has now
been unified to Task
. Usages involving these APIs need to be updated accordingly.
- Added
GuildFeature.Partner
enum value andGuildFeatures.IsPartner
property. - Added
IGuild.Banner
property. - Added
CurrentUserNickname
,CurrentUserDisplayName
, andCurrentUserRoles
properties onRestGuild
. - Added
SyncPermissionsAsync
method onINestedChannel
. - Added
DownloadVoiceStatesAsync
andDownloadBoostSubscriptionsAsync
abstract methods onBaseSocketClient
. - Added
TextChannels
,VoiceChannels
, andCategoryChannels
properties onRestGuild
.
.
- Renamed
GuildFeature.Ka
toGuildFeature.KeyAccount
andGuildFeatures.IsKa
toGuildFeatures.IsKeyAccount
. - Changed
GuildPermissions
to a struct and changedRoleProperties.Permissions
to typeGuildPermissions?
. - For convenience, some events in
BaseSocketClient
have been changed or added with event parameters. See the appendix at the end of the document for details.. - Changed all parameters of
DownloadBoostSubscriptionsAsync
method onBaseSocketClient
to optional parameters. - Changed the type of
RestGuild.Channels
toImmutableDictionary<ulong, RestGuildChannel>
. - Changed the return type of
GetChannelAsync
,GetDMChannelAsync
,GetDMChannelsAsync
, andGetUserAsync
methods onKookSocketClient
toTask<*>
.
- Fixed an issue where some APIs were unable to correctly parse the string
1
or0
when returning a bool type. - Fixed an issue where
IGuild.DefaultChannelId
was not correctly set to the actual default text channel configured on the server. - Fixed an issue where
SocketGuild.CurrentUser
was null when downloading the server user list. - Fixed an issue where
IsOnline
andActiveClient
onSocketUser
could throw null reference exceptions. - Fixed an issue where messages of type
MessageType.Poke
were not correctly parsed. - Fixed an issue where the request bucket was not handling HTTP 429 Too Many Requests errors correctly.
- Optimized the debugger display text of
Cacheable
. FileAttachment.Stream
can now be reused.- The
SendFileAsync
andReplyFileAsync
methods will now cache the asset URI created forFileAttachment
attachments created through files or streams before multiple sends, to avoid uploading the same file repeatedly.
- Fixed some strange code indentation.
- Changed the document theme.
- Added a separate workflow for updating the documentation that depends on the
doc
branch. - Added an API quick reference document.
- Added missing permission values to permission-related unit tests.
Event parameter changes in BaseSocketClient
:
-
ReactionAdded
andReactionRemoved
ISocketMessageChannel
→SocketTextChannel
- Add
Cacheable<SocketGuildUser, ulong>
representing the user who added or removed the reaction
-
DirectReactionAdded
andDirectReactionRemoved
- Add
Cacheable<SocketUser, ulong>
representing the user who added or removed the reaction
- Add
-
MessageReceived
- Add
SocketGuildUser
representing the user who sent the message - Add
SocketTextChannel
representing the text channel where the message was sent
- Add
-
MessageDeleted
、MessageUpdated
、MessagePinned
与MessageUnpinned
ISocketMessageChannel
→SocketTextChannel
-
DirectMessageReceived
- Add
SocketUser
representing the user who sent the message - Add
SocketDMChannel
representing the DM channel where the message was sent
- Add
-
DirectMessageDeleted
Cacheable<IDMChannel, Guid>
→Cacheable<SocketDMChannel, ulong>
- Add
Cacheable<SocketUser, ulong>
representing the user who sent the message
-
DirectMessageUpdated
IDMChannel
→Cacheable<SocketDMChannel, ulong>
- Add
Cacheable<SocketUser, ulong>
representing the user who sent the message
- Fixed an issue where the corresponding permission overwrites of
SocketGuildChannel.UserPermissionOverwrites
andSocketGuildChannel.RolePermissionOverwrites
were not removed when a user left the guild or a role was deleted.
Due to the following reasons, this version has made adjustments to the parameter types passed in some events
in BaseSocketClient
:
- Some parameters are always present and do not need to be wrapped with
Cacheable
, such asMessageDeleted
andUserConnected
. - The data sent by the gateway is incomplete, resulting in missing parameters in some events. These event parameters
have been adjusted to entities wrapped with
Cacheable
to fix the issue of unknown entity IDs that cannot be obtained through the REST client API request for complete data. - The original processing logic for incomplete data sent by the gateway was to obtain complete data by initiating API
requests through the REST client, which may cause performance issues or timeouts in large servers, such
as
GuildMemberOnline
andGuildMemberOffline
. These event parameters have been adjusted to entities wrapped withCacheable
, and can be obtained on demand through theGetOrDownloadAsync
method. - Some event parameters are too specific, resulting in a mismatch of types and passing empty values, such
as
ReactionAdded
. - Some event parameters are too general, such as
MessageDeleted
andUserConnected
, which can avoid unnecessary pattern matching. - Some event parameters are missing, such as
UserBanned
. - Some events pass excessively redundant parameters, such as
MessageButtonClicked
.
Full changes to the event parameters can be found in the appendix at the end of the document. All usages involving these events need to be updated accordingly.
All formatting methods in the KMarkdown formatting helper class Format
have been changed to extension methods, and a
new optional parameter sanitize
has been added to support whether to escape special characters in the text, which
defaults to true. The calling method of extension methods is still compatible with the original static method calling
method. By default, all formatting methods escape special characters in the text that conflict with KMarkdown syntax to
avoid syntax parsing errors. This feature is enabled by default and can be disabled through the sanitize
parameter. If
the text parameter passed to this method has already escaped special characters, the sanitize
parameter should be set
to false
, or the input parameter should be adjusted to the original unescaped text. Additionally, the logic of
the Format.Quote
and Format.BlockQuote
methods have been adjusted. They will now insert line breaks and zero-width
joiners (\u200d
) as needed within the text to maintain the display effect in the KOOK client. The formatting result of
the Format.BlockQuote
method guarantees that the entire text block will be displayed as one quoted block in the KOOK
client, while the formatting result of the Format.Quote
method will split the text into multiple quoted blocks based
on empty lines, with the empty lines not included in the quoted blocks.
The Parse
and TryParse
methods in the CardJsonExtension
class have been renamed to ParseSingle
and TryParseSingle
to avoid conflicts with the ParseMany
and TryParseMany
methods used to parse multiple cards.
All calls involving these methods need to be updated accordingly.
The Features
property type in IGuild
and IRecommendInfo
was originally object[]
, and is now implemented as
the GuildFeatures
type. All calls involving these properties need to be updated accordingly.
The RestPresence
namespace has been corrected to Kook.Rest
. All calls involving RestPresence
need to update the
namespace reference accordingly.
- Added methods for managing friends and blocked users. For details, see the appendix at the end of the document.
- Added debug display text for the
Cacheable
andQuote
classes. - Added
MaxJoinedGuildDataFetchingRetryTimes
andJoinedGuildDataFetchingRetryDelay
properties toKookSocketConfig
for controlling the number of times and delay between retries for fetching data when joining a server. - Added
ParseMany
andTryParseMany
methods toCardJsonExtension
. - (Experimental feature) Added the
IVoiceRegion.MinimumBoostLevel
property. - (Experimental feature) Added
ValidateCardAsync
andValidateCardsAsync
methods toKookRestClient
.
- Changed the parameter types for some events in
BaseSocketClient
. For details, see the appendix at the end of the document. - The formatting methods in the
Format
helper class have been changed to extension methods, and a new optional sanitize parameter has been added to support escaping special characters in the text. The default value istrue
. - Renamed the
Parse
andTryParse
methods inCardJsonExtension
toParseSingle
andTryParseSingle
. - Implemented the
Features
property ofIGuild
andIRecommendInfo
as theGuildFeatures
type. - Corrected the namespace for
RestPresence
toKook.Rest
. - (Experimental feature) The
KookRestClient.GetAdminGuildsAsync
method now supports Bot authentication.
- Fixed an issue where the results of the
Format.Quote
andFormat.BlockQuote
methods were displayed incorrectly in KOOK. - Fixed an issue where the error message in exceptions thrown by
CountdownModuleBuilder.Build
was incorrect. - Fixed an issue where
BaseSocketClient.DirectMessageUpdated
might pass an incorrect user entity. - Fixed an issue where the
Author
property was null in message-related events when the user was not cached. - Fixed an issue where
IGuild.OwnerId
is0
. - Fixed an issue where the
IsPinned
property was not set correctly inBaseSocketClient.Pinned
andBaseSocketClient.Unpinned
events. - Fixed an issue where the
IPresence.ActiveClient
property could be unintentionally cleared. - Fixed an issue where the debug display format of
IPresence
was incorrect. - Fixed an issue where the default implementation of
IRestClient
could throw an exception whenDEBUG_REST
preprocessor directive was enabled for debugging high-concurrency requests in the source code. - Fixed an issue where
Quote.Empty
was not a static property.
- Fixed an issue with missing preprocessor directives in
KookRestApiClient
. - Optimized the
SocketUser.UpdateIntimacyAsync
method's implementation of theIUser
interface. - Improved the use of
NumberBooleanConverter
. KookSocketClient
logs warnings or the content of received packets when they are out of order or not handled correctly.- When printing exception packets,
KookSocketClient
uses the passed-inserializerOptions
serialization options. - Completed XML documentation for
BaseSocketClient
events.
- Due to the issue of missing field values when creating roles being fixed on the KOOK server side, commit 1726d5c7c36ead0544784eb937660537c6ec1f4f has been reverted.
- Corrected some errors in the documentation.
- Fixed the issue where the test server created by integration testing was not properly deleted.
Added APIs:
- Get all friends:
IKookClient.GetFriendsAsync
- Request to add a friend:
IUser.RequestFriendAsync
- Remove a friend:
IUser.RemoveFriendAsync
- Get all friend requests:
IKookClient.GetFriendRequestsAsync
- Accept a friend request:
IFriendRequest.AcceptAsync
- Decline a friend request:
IFriendRequest.DeclineAsync
- Get all blocked users:
IKookClient.GetBlockedUsersAsync
- Block a user:
IUser.BlockAsync
- Unblock a user:
IUser.UnblockAsync
Event parameter changes in BaseSocketClient
:
ReactionAdded
andReactionRemoved
Cacheable<IUserMessage, Guid>
→Cacheable<IMessage, ulong>
Cacheable<IMessageChannel, ulong>
→ISocketMessageChannel
DirectReactionAdded
andDirectReactionRemoved
Cacheable<IUserMessage, Guid>
→Cacheable<IMessage, ulong>
MessageDeleted
Cacheable<IMessageChannel, ulong>
→ISocketMessageChannel
MessageUpdated
Cacheable<IMessage, Guid>
→Cacheable<SocketMessage, Guid>
SocketMessage
→Cacheable<SocketMessage, Guid>
MessagePinned
andMessageUnpinned
Cacheable<IMessage, Guid>
→Cacheable<SocketMessage, Guid>
SocketMessage
→Cacheable<SocketMessage, Guid>
SocketGuildUser
→Cacheable<SocketGuildUser, ulong>
DirectMessageUpdated
SocketMessage
→Cacheable<SocketMessage, Guid>
UserLeft
SocketUser
→Cacheable<SocketUser, ulong>
UserBanned
IReadOnlyCollection<SocketUser>
→IReadOnlyCollection<Cacheable<SocketUser, ulong>>
SocketUser
→Cacheable<SocketUser, ulong>
- Add a new parameter of type
string
to represent the reason for adding to the blacklist.
UserUnbanned
IReadOnlyCollection<SocketUser>
→IReadOnlyCollection<Cacheable<SocketUser, ulong>>
SocketUser
→Cacheable<SocketUser, ulong>
UserUpdated
SocketUser
→Cacheable<SocketUser, ulong>
GuildMemberUpdated
SocketGuildUser
→Cacheable<SocketGuildUser, ulong>
GuildMemberOnline
andGuildMemberOffline
IReadOnlyCollection<SocketGuildUser>
→IReadOnlyCollection<Cacheable<SocketGuildUser, ulong>>
UserConnected
andUserDisconnected
SocketUser
→Cacheable<SocketGuildUser, ulong>
- Remove the
SocketGuild
parameter, please retrieve it fromSocketVoiceChannel.Guild
.
MessageButtonClicked
SocketUser
→Cacheable<SocketGuildUser, ulong>
IMessage
→Cacheable<IMessage, Guid>
- Remove the
SocketGuild
parameter, please retrieve it fromSocketVoiceChannel.Guild
.
DirectMessageButtonClicked
SocketUser
→Cacheable<SocketUser, ulong>
IMessage
→Cacheable<IMessage, Guid>
- Added
ICard.ToJsonString
andICardBuilder.ToJsonString
for cards JSON serialization; AddedCardJsonExtension.Parse
andCardJsonExtension.TryParse
for cards JSON deserialization. (c076ce8feadf9c6aaa54b44bd68466b47d3767e4)
This release changed the default value of everyoneHandling
parameter in IUserMessage.Resolve
to TagHandling.Name
.
All usages of this method need to take note of this change.
- Added method overload
GetUserAsync(string,string,RequestOptions)
to theIKookClient
interface and implemented it inBaseSocketClient
. (6555c2ba0c9993b4523a95a8cbdc544474541984) - Added support to disable Unicode bidirectional formatting of username strings
via
KookConfig.FormatUsersInBidirectionalUnicode
. (bfc038ec4ce68124aa7eef94b421f6d0f1f941ce)
- Fixed issue with
IUserMessage.Resolve
incorrectly textifying mentions for @everyone and @here. (91c1175ad5eb22323cc1fe3a5cc93b9e8fc86ea5) - Fixed deserialization issue with
IGuild.CreateRoleAsync
results. (1726d5c7c36ead0544784eb937660537c6ec1f4f) - (Experimental feature) Fixed issue with
KookRestClient.CreateGuildAsync
not returning complete guild information. (2b5c59d60e8db309c30cf42509a9756625e98903)
- Added XML documentation to all public APIs. (fe1e9bcd0b7bd9a0a99c850234beef1b4993977b, 2ad3301bcc06a731e9f57bbd542484a31e77c438)
- Applied code styling. (6325b16b9ad1f8f958a8eaaf125e7d34ae280a10)
This release added a new optional parameter Nullable<GameCreationSource>
for Kook.GetGamesAsync
,
to support getting games with specified creation source. All usages of this method that pass positional arguments
to RequestOptions
need to be updated.
- Added an optional
Nullable<GameCreationSource>
parameter forKook.GetGamesAsync
. (22b799ac87867590045c87771b0344acd3e80339)
- Added support for parsing color type
ColorType
and gradient color informationGradientColor
for roleIRole
. (9414b94fb60dc6b45f14dc524acc75005071e37f)
- Added
KookRestClient.GetAdminGuildsAsync
for Bearer token. (58a0966d930e16e37f9796d4bd947d2a24aaade2) - Added
Format.Colorize
for KMarkdown text colorization. (acca2ae40b0977ebea237b8cd02195f8758df115)
- Fixed
GetGuildsAsync
downloads data too slowly on massive guilds. (83ba3cadc106c7496c1eb45114ba552cf6ced24e) - Fixed
GetGuildsAsync
does not work on Bearer token. (e7641676ad8efc87e035fd256b57a46606f9e86f) - Fixed potion of values are incorrect in
Color
. (e46cbc088a6d2c48deaee0fd1826ca389d656476)
- Fixed an issue that
SocketTextChannel.SendCard(s)Async
does not assignephemeralUser
parameter well. (7511f113146f85c9f6157534ba2ce1444080b795)
- Fixed incorrect JSON converter resulting in startup failure. (7955aefdfd61fcc28420e30640628890c15ba781)
This release split out non-official listed endpoints implementation into a separate package, namely
INestedChannel.SyncPermissionsAsync
. Developers who are using this endpoints should install the
Kook.Net.Experimental package.
- Removed
INestedChannel.SyncPermissionsAsync
method on interface definition. Implementations are now available on the Kook.Net.Experimental package. (49f2d974640423bfff4dd0eeca3c8f2d9e7c7cd0)
- Added Kook.Net.Experimental package for non-official listed endpoints implementation. (49f2d974640423bfff4dd0eeca3c8f2d9e7c7cd0)
- Fixed potential NRE resulting from empty
IGuild.OpenId
. (f112a37073171fb02b79c46a56741a62f00461c2)
- Fixed incorrect indentations. (d3e974bae04b3097554dd646117e502e4026d3e3)
This release changed the type of SocketGuild.MemberCount
from int
to int?
, where the null
value represents
that the number of the guild members is unknown. In addition, similar changes occur on SocketGuild.HasAllMembers
.
All usages relying on these two properties need to be updated.
AlwaysDownloadUsers
will also define whether the number of guild members will be loaded upon startup (8f4fb79643eebd07f4736a681ddc30f3f04d6f20)
- Fixed incorrect preconditions when modifying voice channels (9f808b3a2153d2e0a37aceaad8097768288d43de)
- Fixed incorrect documentation (9e2669a56267970e4295555cf6e8840dfa28f6ab)
- Added
IGuild.GetActiveBoostSubscriptionsAsync()
(32b1617a2e8c6bb0fa86f3e2ebc40e97a203bf61) - Payloads themselves will be logged as well when deserialization exceptions occur ( 369dd044f5bd4e94bec37c4ba8e4d76e586cd01d)
- Fixed
BaseSocketClient.UserUnbanned
that was not working (624750a0427925fb4b42e26720708b4cc9d60d1c) - Fix
DownloadVoiceStatesAsync
andDownloadBoostSubscriptionsAsync
were bypassed unexpectedly whenBaseSocketClient.GuildAvailable
is triggered (390b8ab65ad6cab22142c33ee51a62e54b3c1870)
Initial release.