- slash commands and interactions have been redesigned to support the new command and interaction types.
- Move SlashCommands functions to Kord. (#366)
- ApplicationCommands are now cached. (#366)
- Interaction events are split up into distinct events. (#366)
- Proper hierarchy for applications commands, interactions and their events. (#366)
- Rename
UsePrivate/PublicThreads
toCreatePrivate/PublicThreads
. (#366) - Include json error in exception message. (#369)
- Experimental Voice support. #(363)
- Context support. (#366)
- Add
ResolvedObjects#messages
to resolve messages. (#366) - Add
ChannelBehavior#of/OrNull
to safely get a typed channel. (#366) - Add type safe arguments for chat input commands. (#366)
- Add SendMessagesInThread Permission. (#366)
- Ephemeral followups not being passed the ephemeral flags. (#368)
- Missing optional default values in some data types. (#362)
- incorrect serialization of
CommandArguement
. (#362)
- Fixed the space in active threads get endpoint causing it to fail. (5dd3f380)
- Fixed incorrect serialization of
NUMBER
option. (#360) - Fixed Missing properties in
MemberData
,InteractionData
and others. (#361)
Region
no longer has avip
property (5dd3f380)
- Fixed Typo in ephemeral acks body causing acking to fail.
- interaction acknowledgements no longer require data
- Add SerialName for
InteractionApplicationCommandCallbackData#allowedMentions
- Added support for threads. (#349 #358 #353 d1bf947)
- Added missing JSON error codes. (#347)
- Added support for slash command number type arguments. (#351)
- Added support for user banners. (#352)
- Added missing guild features. (d1bf947)
- The
Channel
hierarchy has been changed to support threads. Some behavior inGuildChannel(Behavior)
andGuildMessageChannel(Behavior)
has been removed to accommodateThreadChannel
s and moved toTopGuildChannel(Behavior)
andTopGuildMessageChannel(Behavior)
respectively. (#353)
- Fixed missing audit log reasons on certain endpoints. (#346)
- Promote user property in component interaction to a data object.
- Fixed
ComponentInteraction#user
throwing aNullPointerException
when the interaction was created in a direct message.
- Add StoreEntitySupplier.
- Add caching rest strategy.
- Add cache-rest caching strategy.
- Add select menus.
- Fix average ping conversion in
MasterGateway
.
- Make
UpdateMessageInteractionResponseCreateBuilder
fields nullable. - type in option builders is now private
- DiscordComponent
- InteractionCallbackData
- ApplicationInteractionData
- ComponentData
- CommandInteraction
- OptionsBuilder
- UpdateMessageInteractionResponseCreateBuilder
- Allow adding a mentionable argument to commands
- Make
Intent#values
a getter function.
- Mentionable arguments now correctly retrieve their entity.
Intent.values
emitting null when filtering.
BaseInteractionResponseBuilder
BaseInteractionResponseBuilder
BaseInteractionResponseModifyBuilder
EphemeralInteractionResponseModifyBuilder
PublicInteractionResponseModifyBuilder
MessageModifyBuilder
EditWebhookMessageBuilder
InteractionResponseModifyRequest
FollowupMessageBuilder
PublicFollowupMessageModifyBuilder
EphemeralFollowupMessageModifyBuilder
PublicFollowupMessageCreateBuilder
EphemeralFollowupMessageCreateBuilder
FollowupMessageModifyRequest
ComponentInteraction
- Message-related builders have been changed to accept
null
(for non-collections) and "empty list" (for collections) when editing a message. This makes it possible to remove fields from a message without providing a substitution. FollowupMessageBuilder
no longer has thetts
field, since it does not apply to all its subclasses.
ActionRowComponent
properly returns its children.ComponentInteraction#button
is now nullable as its documentation implies.
- Implement voice stage channel (#239)
- Add "Competing" activity type (#272)
- Add unsafe application commands behavior (#281)
- Add buttons to Activity (#287)
- Add Message.applicationId (#289)
- Implement Stage instances (#291)
- Add Message interaction (#283)
- Add Ephemeral embed support (#296 #321)
- Update deprecated message (#280)
- Sealed message types (#282)
- Improve slash command API and add support for components (#310 #294 #312 #324)
- Live entities can define a parent job (#304)
- Close InputStreams used for attachments (#309 #296)
- Make Updatestatus activities not-null (#274)
- Fix GuildUpdate core handling (#284)
- Fix memory issues related to Permission combining (#277)
- kotlin 1.4.32 -> 1.5.10
- kotlinxSerialization 1.1.0 -> 1.2.1
- ktor 1.5.2 -> 1.6.0
- kotlinxCoroutines = 1.4.2 -> 1.5.0
- kotlinLogging 2.0.4 -> 2.0.6
- atomicFu 0.15.1 -> 0.16.1
- binaryCompatibilityValidator 0.4.0 -> 0.5.0
- datetime 0.2.1
- Unhandled missing access when trying to get vanity url with the feature disabled. #264
- Added slash commands support. #145 #201 #253 #249
- Added core representation of templates #136
- Added overloaded operations for Intents and Permissions. #152 #203
- Added welcome screens. #141
- Added
Kord#getInvite
. #143 - Added pending property to member. #153
- Added
Kord
functions to get webhooks. #232 - Added ability to send a message through request. #184
- Added extension methods for
LiveEntity
. #177 - Added
USE_SLASH_COMMANDS
permission. #208 - Added
Permission#values
andPermissions#values
. #255 - Added allowed mentions. #256
- Added new webhook endpoints. #217
- Added missing error codes. #250
- Added
Message#messageReference
. #245
- Fix
GuildBehavior#getWidgetOrNull
#138 - Fix nullity in builders. #135
- Fix channelId nullity in UpdateVoiceState. #144
- Fix provider nullity in embeds. #151
- Fix WebhookType.Incoming incorrect value. #156
- Fix
DiscordErrorResponse
inability to consume full input #162 - Fix
MessageCreateEvent#withStrategy
returningStrategizable
. #233 - Fix serialization issues for
DiscordActivityPartySize
. #168 - Fix
Attachment#isImage
check. #172 - Fix
rpc_origins
being nullable instead of optional. #173 - Fix
LiveMessage
not being shut down on bulk delete. #174 - Fix
Message#authorAsMember
throwing if guild was not found. #178 - Fix swapped
mute
anddeaf
inVoiceStateData
. #188 - Fix
preview_asset
not being optional. #206. - Fix parsing raw responses into Json. #205
- Fix typos in webhook and welcome screen routes. #219 #220
- Fix gateway 0 blocking other shard gateways from running. #194
- Fix unhandled unknown channel types. #251
- Allow controlling the number of total shards #196
- Replaced invoke functions with top-level factory functions. #210
- Allow multiple file upload. #247 #228 #229
- Added missing contracts #243
- kotlin 1.4.10 -> 1.4.32 #198
- kotlinx.serialization 1.0.0 -> 1.1.0 #198
- kotlinx.coroutines 1.4.0 -> 1.4.2 #198
- kotlinx.atomicfu 0.14.4 -> 0.15.1 #198
- kotlinx.binary-compatibility-validator 0.2.3 -> 0.4.0 #198
- ktor 1.4.1 -> 1.5.2 #198
- kotlin-logging 2.0.3 -> 2.0.4 #198
- Added support for
MessageSticker
. #119 - Added support for
RoleTags
. #119 - Added
GuildBehavior#getMembers
. #119 - Added the ability to move a channel under a category when moving channels. #119
- Fixed
MemberBehavior#edit
, now returning a member. #120 Gateway#on
now allows suspending consumers.- Fixed
GuildBehavior#editSelfNickname
incorrectly parsing the response json. #125 - Fixed getting user's avatar url. #128
VoiceServerUpdateEvent#endpoint
is now nullable. #119- Moved com.gitlab.kord.common to dev.kord.common. #122
- Moved com.gitlab.kord.rest to dev.kord.rest. #122
- Moved com.gitlab.kord.gateway to dev.kord.gateway. #122
- Moved com.gitlab.kord.core to dev.kord.core. #122
- Removed deprecated API from 0.6.x.
- Re-added
values
inIntent
andIntents
. - Added support for inline replies and
MessageBehavior#reply
to quickly create a reply to a message. #110 - Added a shortcut to create channels from a
CategoryBehavior
, giving them a parentId by default. #109 - Added
Gateway#requestMembers
andGuildBehavior#RequestMembers
as a shortcut for theRequestGuildMembers
command.
- Fixed Color bug when converting from java.awt.Color with alpha. #114
- Gateway reconnect retries reset on handshake. #68
- Updated API to Discord V8. #108
- Introduced Optionals in lower level API and core xData classes. #108 #95
- De-inlined Snowflake and implemented it into the lower level API. #108
- Rewrote
AuditLog
and its child classes and introduced them to tocore
. #108 Kord#events
is now aSharedFlow
which can be configured viaKordBuilder#eventFlow
. #102Image
now supports image sizes that are common for Discord image resources. #98java.awt.Color
has been replaced withcom.gitlab.kordlib.common.Color
. #5core
Entities should have a meaningfultoString
representation. #88- Request builders no longer have
lateinit
fields, these are now required arguments in the builder DSLs. #108 Permissions
andIntents
now have more and easier constructors. #103
RestRequestException
now holds a reference to an (optional)DiscordErrorResponse
with a more specific error message and code.PremiumTier
now has amaxEmotes
field. #74- Added a
getDmChannelOrNull
toUserBehavior
to safely try and open a DmChannel with a user. #111
GuildBehavior#getVanityUrl
will now correctly return null when the guild does not have a vanity url.- Voice channels can now change their topic.
- Fixed
CacheEntitySupplier
not returning certain cached entities.
- Kotlin 1.4.0 -> 1.4.10
- ktor 1.4.0 -> 1.4.1
- kotlinx.serialization 1.0.0-RC -> 1.0.0
- kotlinx.coroutines 1.3.9 -> 1.4.0
- kotlinLogging 1.7.10 -> 2.0.3
- Fixed
Guild#getVanityUrl
throwing an exception when a guild did not support vanity invites. #104 - Fixed
Embed#fields
always returning empty. #105
- Fixed
Rolebehavior#mention
foreveryone
roles. #96 - Fixed NPE being thrown when trying to query data types that were not cached.
- Fixed message content not being sent when uploading a file. #99
- Fixed rest action reasons not encoding properly. #86
- Fixed removed channels not being removed from cache. #84
- Fixed an issue where
Members
would not considerUsers
with the same ID equal. - Removed a dependency on Java 10 introduced in 0.6.5. #78
- Fixed the event flow dropping events under too much pressure. #81
- Fixed the
KordCacheBuilder
ignoring configuration #82
- Fixed an issue where
LiveMessage
would not filter its event flow. #70 - Fixed an issue where emojis from events would be decoded incorrectly.
- Added a
MemberBehavior#addRole
andMemberBehavior#removeRole
variant which accepts an audit log message.
- Fixed GuildMessageChannelBehavior#bulkdelete incorrectly deleting messages older than 14 days
- Added a new
Field
builder function. #57 - Added
Kord#getChannelOf
to request a type of channel.
name
andvalue
default to empty space.PRESENCES_REPLACE
event will be ignored. #42
- Added
Team
and other properties to ApplicationInfo.
ReactionEmoji.Unicode
now correctly compares on name for equality.
CacheEntitySupplier#getGuildMembers
will no longer query MemberData on each user.- Reduced the number of mappings inside suppliers.
- Fixed type mismatch when comparing guildId in
CacheEntitySupplier#getGuildMembers
Member#kick
andGuild#kick
now have an optional reason.KordBuilder
now throws a (more) useful exception when building a bot with an invalid token.- The REST module will now use
discord.com/api
instead of the deprecateddiscordapp.com/api
. - Kord now uses
Dispatchers.default
as the default dispatcher.
- Fixed an issue where Invite events would not fire if the invited user didn't have an avatar.
- Fixed some outdated docs on the
KordBuilder
. - Fixed an issue where voice states from guild creates were not getting cached.
- Introduced an experimental REST-only variant of the Kord builder. This will automatically disable gateway and cache related APIs and replace them with a no-op implementation.
- Introduced a no-op
Gateway
implementation.
- Removed an unneeded REST call when building Kord.
- kotlin 1.3.72 -> 1.4.0
- ktor 1.3.2 -> 1.4.0
- kotlinx.serialization 0.2.0 -> 1.0.0-RC
- kotlinx.coroutines 1.3.7 -> 1.3.9
- Fixed an issue where multiple voice states could be present per user per guild.
- Fixed an issue where presences would be incorrectly deserialized in guild member chunk events.
- Fixes member chunk events not caching presences.
- Fixed an issue with entity flows requested from REST duplicating entities.
- Fixed an issue where getting a channel from a guild would incorrectly throw an exception during the guild id check. (again)
- Fixed an issue where getting a channel from a guild would incorrectly throw an exception during the guild id check.
- Added
BanAddEvent#getBan
to get the full ban object. - Re-added
MessageCreateBuilder#allowedMentions
after removal in 0.5.0.
- Fixed incorrect calculations of denied
Permissions
.
- Added
MessageBehavior#publish
to publish a message in an announcement channel. - Added
NewsChannelBehavior#follow
to follow an announcement channel in another text channel.
- Fixed
GuildChannel#getEffectivePermissions
not correctly denying permissions denied for the user specifically.
- Added
GuildBehavior#getChannel
,GuildBehavior#getChannelOf
and their nullable variants.
GuildBehavior#unBan
has been deprecated forGuildBehavior#unban
.
getGuildMembers
returns the correct limit for both Cache and Rest suppliers.
- Add missing mention property for unicode emojis.
- Re-add
guildId
toInvite
for compatibility.
- Added
PartialGuild
inInvite
- Added
GuildBehavior.createEmoji
- Added
GuildEmoji.delete
andGuildEmoji.edit
DiscordInvite#targetUser
is now correctly nullable.PermissionOverwriteEntity#getGuildOrNull
uses the correct supplier method.
Invite
now uses aChannel
instead ofGuildChannel
.
mention
properties forGuildEmoji
andReactionEmoji
- Added Gateway Intents, allowing users to filter events send by Discord. #60
- Added
VIEW_GUILD_INSIGHTS
permission #88 - Added
MessageCreateEvent#guildId
to replace the removedMessage#guildId
. - Added
MessageCreateEvent#member
.
- Removed deprecated API from 0.4.x
- kotlin 1.3.70 -> 1.3.72
- ktor 1.3.1 -> 1.3.2
- kotlinx.coroutines 1.3.4 -> 1.3.7
- kotlin-logging 1.7.8 -> 1.7.10
- Getting entities from a flow of non-cached entities should be considerably faster.
- non-final socket closures use 4900 instead of 1000.
- Added the
EntitySupplyStrategy
, entities will now keep a reference to aEntitySupplier
(fetched from the strategy) from which they'll be able to fetch other entities (getX
methods). #74 - Added
withStrategy(EntitySupplyStrategy)
to change theEntitySupplier
of most entities. #74 - Added a
CacheEntitySupplier
andRestEntitySupplier
supplier that exclusively operates on Cache and REST respectively, as well as a strategy that prioritizes Cache over REST like previous versions. #74 - Added
getXOrNull
variants to fetching entities that won't explode when trying to get an entity that doesn't exist. #74
- Changed
GuildCreateBuilder
to be more inline with recent api changes. #77 core
Event constructors are no longer internal.Kord#gateway
is now aMasterGateway
, exposing all sharded gateways #65core
Events now expose their shard index as well as theGateway
they were spawned from. #65DisconnectEvent
andClose
have been extended with more detailed implementations #65Gateway
now accepts aPresenceBuilder
to configure its original presence. #72- Rest Discord API version can now be configured by setting the
com.gitlab.kordlib.rest.version
system property,v6
by default. DefaultGateway
now supports zlib compression and enables it by default.
This release contains breaking changes related to webhooks.
- Added
WebhookBehavior#executeIgnored
which does not wait for the message to be processed.
WebhookBehavior#execute
will now return aMessage
.
- Fixed an issue when deserializing a Webhook would throw an exception.
- Fixed an issue where endpoints returning nullable types would throw an exception.
- Fixed cache not removing messages deleted from a
MessageDeleteBulk
.
- Added error codes 10026(Unknown ban), 40002(You need to verify your account in order to perform this action) and
30015(Maximum number of attachments in a message reached (10)) to the
JsonErrorCode
. - Added
approximate_member_count
approximate_presence_count
to guilds, which will be present when requesting a guild through rest. - Added missing
DmChannel#recipientBehaviors
. - Added missing
MessageUpdateEvent#message
,MessageUpdateEvent#channel
,MessageUpdateEvent#getMessage
,MessageUpdateEvent#getChannel
. - Added missing
PresenceUpdateEvent#member
,PresenceUpdateEvent#guild
,PresenceUpdateEvent#getUser
,PresenceUpdateEvent#getMember
,PresenceUpdateEvent#member
,PresenceUpdateEvent#getGuild
. - Added
chunk_index
andchunck_count
properties toGuildMembersChunkData
. - Added
Invite#targetUserType
. - Added
User#flag
. - Added
GuildFeature.WelcomeScreenEnabled
. - Added
MessageModifyBuilder#allowedMentions
. Embeds
can now copy their contents over to builders by usingEmbed#apply(EmbedBuilder)
.- Added
User#premiumType
. - Added
GuildPreview
and the ability to get previews for public guilds viaKord#getGuildPreview
.
- Fixed
MessageModifyBuilder
ignoring flags.
- Fixed an issue where
ClientStatus
would only display the desktop status.
- Fixed an issue where presences from guild creates were cached without guild id.
- Fixed REST throwing an exception when parsing an error without code.
- Behaviors have been removed from VoiceState due to lack of guildId.
- Unmatched data structure between VoiceState and its data.
- ISO_INSTANT not being used to format and Instant object.
- Classes implementing
Entity
now correctly implement equals and hashcode based on ids.
- Fix
GuildMessageChannelBehavior#bulkDelete
manually deleting messages younger than 14 days and trying to bulk delete messages older than 14 days, instead of the other way around.
- Fix guild emojis not having their correct id.
- Fix unexpected data fields throwing exceptions when parsing
Gateway
Events
. This should now be limited to unknown opcodes only.
ParallelRequestRateLimiter
will no longer try to unlock a mutex twice on a error response
DiscordErrorResponse
incorrect serialization
ID collections in modify builders have undergone a breaking critical bug fix.
- Added
JsonErrorCode
andDiscordErrorResponse
to map Discord's Json error messages.
- Added
error
field toKtorRequestException
to includeDiscordErrorResponse
- Fixed
permissionOverwrites
inTextChannelModifyBuilder
,VoiceChannelModifyBuilder
,NewsChannelModifyBuilder
being final. - Fixed
roles
inEmojiModifyBuilder
andMemberModifyBuilder
being final.
- Added Integrations.
- Guilds can now request their own Integrations with
GuildBhehavior#integrations
. - Added
preferredLocale
andpublicUpdatesChannelId
toGuild
andGuildModifyBuilder
. - Added some utility functions to the
KordCacheBuilder
. - Added
GuildDiscoveryDisqualified
andGuildDiscoveryRequalified
toMessageType
. #79
KtorRequestHandler
will now log the body of requests and responses.
- The GuildService now returns the correct type of integration objects.
- Fixed a typo in the
Embed#type
property kdocs. - Fixed an issue where paginated flows would emit duplicate items.
Embed#type
has been deprecated. #80LiveNewsChannel
,LiveStoreChannel
andLiveTextChannel
have been deprecated. Message channels in guilds can change type during their lifetime, which means type can't be guaranteed.LiveGuildMessageChannel
has been introduced as an alternative.
- Fixed an issue where editing a guild category would reset permissions.
- Fixed an issue where editing a guild emoji would reset permissions.
- Fixed an issue where editing a guild member would reset permissions.
- Removed some
Kord
functions that fetched non 'top-level' entities. Kord is no longer the central source for getting entities and these changes try to reflect that. #74 You should use the new entity suppliers for those instead. #74 KordCache
has been removed, Kord now keeps a reference to a generic cache instead. You can still get similar behavior usingkord.with(EntitySupplyStrategy.cache)
. #74
- Added
Guild#memberCount
. - Added
GuildEmoji#isAvaiable
. #84 - Added allowed mentions to message create. #83
MessageChannel#withTyping
should now properly stop when cancelling the coroutine context
- Fixed channels cached in guild create events not having a guild id.
- Fixed
DiscordCreatedInvite#maxUses
serialization typo. - Fixed an issue where editing a guild channel would reset permissions.
- Added
Member#roleBehaviors
- You can now add or remove entire
Permissions
to/from thePermissionsBuilder
- Added
Member#isOwner
- Added
Member#getPermissions
- Added
Message.isPinned
- Added
GuildChannel#getEffectivePermissions
Message#guildId
andMessage#guild
are deprecated due to inconsistent availability.- removed
ReactionEmoji.id
due to compiler issues regarding nullable inline classes, check for Custom type instead.
- Guild emojis update correctly on
GuildEmojisUpdate
event. - Ratelimiters should no longer lock up when throwing an exception during requests.
- Added
MessageBehavior#withTyping
.
- usage of
kotlinx.io.inputstream
has been replaced withjava.io.inputstream
following the internalization of the typealias.
- kotlin 1.3.61 -> 1.3.70
- kotlinx.serialization 0.14.0 -> 0.20.0
- kotlinx.coroutines 1.3.3 -> 1.3.4
- Added
Guild#roleBehaviors
.
- Fix incorrect deserialization of mentioned roles in messages.
- Message updates now correctly update mentioned channels.
- Added
GuildBehavior.getRole
. - Added missing
Guild.channelIds
andGuild.channelBehaviors
.
- Added a
CategoryCreateBuilder
toGuildBehavior
. #67
- Removed
url
fromEmbedFooterRequest
, as it's not an actual field in the Discord API. #66
Kord
and itsCache
now implement a common interfaceEntitySupplier
to retrieve entities that can be cached. #54mentionedRoleIds
,mentionedRoleBehaviors
,mentionedUserIds
,mentionedUserBehaviors
were added toMessage
.- Introduced two implementations for the
RequestRateLimiter
:ExclusionRequestRateLimiter
andParallelRequestRateLimiter
, which will be replacing theExclusionRequestHandler
andParallelRequestHandler
respectively. #59
- All fields but
name
are now optional inGuildCreateBuilder
andGuildCreateRequest
. #62 - Removed the
ExclusionRequestHandler
andParallelRequestHandler
and introduced theKtorRequestHandler
, which accepts anyRequestRateLimiter
. #59 Message#mentionedRoles
andMessage#mentionedUsers
now return aFlow
of their respective entities instead of aSet<Snwoflake>
.StoreChannel#edit
,TextChannel#edit
andNewsChannel#edit
now supply their builder as a receiver.- core entity builders were moved from
com.gitlab.kordlib.core.builder
tocom.gitlab.kordlib.rest.builder
and are now part of the rest module. Snowflake
was moved to the common module from core. #53Kord#getRegions()
was deprecated forKord#regions
.Kord#getUsers()
was deprecated forcache#users
.- various Snowflake argument names have been changed in
Kord
to better reflect the entity they represent. - A reified
getChannel
has been added toEntitySupplier
that will try to cast the channel to the given type. CategoryModifyBuilder#permissions
is now aval
.ChannelPermissionModifyBuilder
is now a properAuditRequestBuilder
.
- fixed typo
CategoryModifyBuilder#positon
->CategoryModifyBuilder#position
-
Fixed
guild-id
being wrongly deserialized asguildId
inDiscordAddedGuildMember
. -
Fixed an issue where disconnecting from the
DefaultGateway
without closing the connection (i.e. dropping your internet connection) would indefinitely suspend theDefaultGateway
, making it unusable.
- Added
InviteCreate
,InviteDelete
anMessageReactionRemoveEmoji
events. #61 - Added
deleteAllReactionsForEmoji
to ChannelService. #61
- Fixed an issue where
DiscordInvite
was wrongly representinginviter
as aString
instead of aDiscordUser
.
- ktor 1.3.0-rc2 -> 1.3.0
- Fixed an issue with Kord ignoring cached entries that relied on querying data by id. again.
This version contains an upgrade of ktor that brings breaking changes, be sure to check out ktor's changelog if you were interacting with ktor or the rest module directly.
This change also comes with the removal of kotlinx.io, which was a transitive dependency. If your code relied on kotlinx.io consider manually including the dependency or migrating away from it entirely.
Kord#getGuilds()
has been replaced with the non-suspendingKord#guilds
.@KordBuilder
has been renamed to@KordDsl
.KordClientBuilder
has been renamed toKordBuilder
.fileName
has been renamed tofilename
.DefaultGateway
's constructor accepts a singleDefaultGatewayData
instead of multiple properties.DefaultGateway
is now able to rate limit identify attempts and accepts aRateLimiter
that can be shared between multiple gateways. This will be done by default for Kord clients now.KordClientBuilder
'sgateway
function has been renamed togateways
. It now gives a list of shards and requests a list of gateways, this change allows you to more easily share configuration between gateways.- Emojis now have nullable names, this only appears when interacting with guild emojis that have been deleted.
- Rest, Gateway and Common entities have gained a
Discord
prefix to reduce name collisions with Core. ParallalRequestHandler
has been upgraded to stable.features
inGuilds
are now represented as enum values instead of Strings.
- Added
LiveEntity
and its implementations to Core. These are self-updating entities that contain a filtered event stream, only emitting related events. - Added
targetUser
andtargetUserType
to invite creation. #47 - Added a
rules channel
,SystemChannelFlags
anddiscoverySplash
toGuild
. #48 - Added
premium since
toMember
. #45 - Added
inviter
toInvite
. #44
- Ending the process while enabling the shutdownHook and without logging in causes UninitializedPropertyAccessException #50
- gradle 5.4 -> 6.0.1
- kotlin -> 1.3.60 -> 1.3.61
- kotlinx.serialization 0.13.0 -> 0.14.0
- ktor 1.2.5 -> 1.3.0-rc2
- kotlinx.coroutines 1.3.2 -> 1.3.3
- kotlin-logging 1.7.6 -> 1.7.8
uses
has been added as a nullable property toInviteResponse
.- Added
mentionedChannel
-related fields toMessage
. - Added
KordClientBuilder#enableShutdownHook
, which enables a shutdownHook that automatically closes the gateway on process exit.
User.Avatar#getUrl
no longer returnsnull
when requesting a static version of a user's animated avatar.
- Fixed an issue where
PartialEmoji
would not deserialize with a missingid
. - Fixed an issue where subscribing to the
events
Flow while kord was already logged in caused it to emit old events. - Fixed an issue where
DefaultGateway
would stop reading payloads after throwing an Exception while parsing json.
Enums now have an Unknown
value to mitigate the effects of unannounced discord changes moving forward. #39
nicknameMention
has been added toMemberBehavior
Flow
extension now support suspending functions
MessageCreateBuilder#addFile
no longer ignores files added.GuildMembersChunkData#presences
has become nullable.RequestGuildMembers#query
is no longer nullable.- Fixed an issue with Kord ignoring cached entries that relied on querying data by id.
User#discriminator
andUser#tag
will now properly format discriminators with leading spaces.
- kotlin-logging: 1.7.6
- kotlinx.coroutines: 1.3.2
- kotlinx.serialization 0.13.0
- ktor 1.2.5
A new RequestHandler
, the ParallalRequestHandler
has been introduced as a preview feature. Compared to the
ExclusionRequestHandler
, this handler offers increased parallelism by allowing requests with different identifiers
to be handled in parallel. The drawback is that this opens a small window for exceeding the global rate limit.
Gateway
now has a ping
field, containing the duration between the latest heartbeat and heartbeat ack.
GuildModifyRequest
now has an optional banner
field, which can contain a base64 16:9 png/jpeg image for the guild banner (when the server has BANNER feature)
.
Added presences
and userIds
to the RequestGuildMembers
class and the equivalents to GuildMembersChunkData
.
Invite#revoked
has been removed since it never existed.
filename
is now correctly deserialized for Attachment
objects.
Gateway
now has a ping
field, containing the duration between the latest heartbeat and heartbeat ack.
This is the first maintenance update for Kord 0.2. With it, we have started hosting Kord on bintray, check our README on what to include to get the newest version.
- Added
Flow<T: Any>.firstOrNull
andFlow<T: Any>.any
as their behavior is often needed when interacting with flows of members, channels, etc (and really, they should've been part of the coroutines api). - Added
isSelfSteaming
toVoiceState
, indicating when a user is streaming using "Go Live".
KordClientBuilder
now allows you to pass a customCoroutineDispatcher
.- Since most suspending calls in Kord will be IO related,
Kord
now usesDispatchers.IO
as itsCoroutineDispatcher
. StoreChannel
can no longer be used to read or send messages. discord api.NewsChannel
andStoreChannel
have been upgraded to the stable api and are no longer in preview.ExclusionRequestHandler
now takes request buckets into consideration.
This is the first maintenance update for Kord 0.2. With it, we have started hosting Kord on bintray, check our README on what to include to get the newest version.
- Added
Flow<T: Any>.firstOrNull
andFlow<T: Any>.any
as their behavior is often needed when interacting with flows of members, channels, etc (and really, they should've been part of the coroutines api).
KordClientBuilder
now allows you to pass a customCoroutineDispatcher
.- Since most suspending calls in Kord will be IO related,
Kord
now usesDispatchers.IO
as itsCoroutineDispatcher
. StoreChannel
can no longer be used to read or send messages. discord api.NewsChannel
andStoreChannel
have been upgraded to the stable api and are no longer in preview.
-
Added the
core
module, a wrapper aroundgateway
andrest
that introduces caching using ourcache
module. As with all our api, it's not stable yet and we will probably continue to introduce breaking changes to improve the general look and feel and fix design flaws. -
Along with
core
comes the concept of entityBehaviour
, which are stripped down discord entities (mostly only retaining their id) that are able to interact with rest on a higher level than therest
module exposes. This is specifically geared towards users who have disabled caching, but its use should be preferred towards anyone who doesn't want to risk increased cache hits or rest calls. -
Gateways
now come with adetach
function, which will allow implementations to (permanently) shut down and release all resources.DefaultGateway
didn't require this, but other implementations that use e.g. thread pools can now shut those down in here. -
DefaultGateway
now comes with a builder dsl that has sane defaults. -
ExclusionHandler
now comes with a secondary constructor that accepts a token.
- Kotlin's experimental
Duration
has replacedLong
typed arguments that represented durations in milliseconds. The previous functions/constructors have been marked with@Deprecated
and should be replaced with the new ones.
- Numerous nullability fixes and other inconsistencies with/because of the discord api.
- Added the
rest
module, a direct mapping of Discord's REST API with rate limiting - Added a common module, containing shared code between rest and gateway
- Preview and Experimental annotations
- Moved shared json classes to common
- Removed Snowflake from common and gateway
- guildId field has been renamed to id in GuildIntegrations
- The color field in Embed is now optional
- The timestamp filed in Embed is now optional
- The All Permission now correctly represents all permissions
- Missing fields have been added to GuildIntegrations
- DefaultGateway should now correctly reconnect on reconnect events
- DefaultGateway should no longer delay on user invoked close