🗂️Changelog
All changes for the Discord.swift library.
0.1.4-beta (not officially released)
New Features
Implementation of authenticated attachment URL parameters
Added property
Message.Attachment.expires
Added property
Message.Attachment.issued
Added property
Message.Attachment.signature
Added property
ThreadChannel.ownerId
Added parameter
clearCache
toBot.disconnect()
. This allows you to preserve the cache if the manual disconnect is only temporary instead of a forced clear.
Bug Fixes
Fixed an issue introduced in 0.1.2-beta where messages could not be removed from the cache after they have been expired if using
Bot.run()
Fixed an issue where more than one identify payload would be sent at some point during uptime which would result in an error.
Updated
If the value passed to parameter
timeout
inUI.init()
happened to be below 0, its default value is now set to 0 instead of theUI.init()
default value. This means theUI.onTimeout
closure is immediately executed, unlike before where it would wait 120 seconds.
0.1.3-beta
New Features
Released on Oct. 8, 2023
Added parameter
platform
toEventListener.onPresenceUpdate()
Implementation of premium app subscriptions
Added struct
Application.Sku
Added enum
Application.SkuType
Added enum
Application.SkuFlag
Added struct
Application.Entitlement
Added enum
Application.EntitlementType
Added property
Interaction.entitlements
Added method
Interaction.respondWithPremiumRequired()
Added enum case
InteractionCallbackType.premiumRequired
Added method
Bot.createTestEntitlement()
Added method
Bot.entitlements()
Added method
Bot.skus()
Added method
EventListener.onEntitlementCreate()
Added method
EventListener.onEntitlementUpdate()
Added method
EventListener.onEntitlementDelete()
Bug Fixes
Fixed an issue where the bot would disconnect randomly after an arbitrary amount of time. With this fix, an additional layer of gateway disconnect protection has been added. The bot is now aware of if it did/did not receive a heartbeat ACK in response to a sent heartbeat, and will reconnect if a heartbeat ACK was not sent by Discord.
Fixed an issue where if a Discord server outage occurred, upon the guild being available again, there was a possibility that its cached members in property
Guild.members
could be removed/replaced.Fixed an issue where it was possible to have multiple heartbeats being sent simultaneously after a new gateway session was started due to an unlikely invalidated session.
Updated
(Breaking Change) Removed
EventListener.onDisconnect()
(Breaking Change) Parameter
activities
inEventListener.onPresenceUpdate()
is longer an optional type.
0.1.2-beta
Released on Sept. 29, 2023
New Features
Added property
Message.customEmojis
Added property
Markdown.mentionServerGuide
Added method
EventListener.onDisconnect()
Added method
Bot.run()
Added method
Bot.close()
Added struct
SelectMenu.DefaultValue
Added property
SelectMenu.defaultValues
Added parameter
defaultValues
toSelectMenu.init()
Bug Fixes
Fixed an issue where if
Bot.disconnect()
was used and the app didn't immediately exit/terminate, CPU and memory usage would peak indefinitely which would render your app unusable. With this fix, users can now freely connect and disconnect without issue (see updated).Fixed an issue where an additional typing indicator would still be displayed even after
Messageable.triggerTyping(while:)
was finished executing.
Updated
(Breaking Change) With bug fix #1, the way you connect to Discord has changed. With this update,
Bot.connect()
no longerthrows
, is not anasync
method, and does not block to maintain the connection. MethodBot.disconnect()
also no longer releases that block, they simply do as their name suggests, connects and disconnects. To connect and block to maintain the connection, you now useBot.run()
and to release the block, useBot.close()
(Breaking Change) Property
Bot.users
is now of typeSet<User>
(Breaking Change) The following have been renamed:
EventListener.init(name:isEnabled)
→EventListener.init(name:enabled)
SelectMenu.MenuType.channels
→SelectMenu.MenuType.channel
SelectMenu.disabled
→SelectMenu.isDisabled
SelectMenu.Option.default
→SelectMenu.Option.isDefault
Guild.chunked
→Guild.isChunked
Asset.animated
→Asset.isAnimated
AutoModerationRule.enabled
→AutoModerationRule.isEnabled
ForumChannel.Tag.moderated
→ForumChannel.Tag.isModerated
VoiceChannel.State.guildDeafened
→VoiceChannel.State.isGuildDeafened
VoiceChannel.State.guildMuted
→VoiceChannel.State.isGuildMuted
VoiceChannel.State.selfDeafened
→VoiceChannel.State.isSelfDeafened
VoiceChannel.State.selfMuted
→VoiceChannel.State.isSelfMuted
VoiceChannel.State.streaming
→VoiceChannel.State.isStreaming
VoiceChannel.State.cameraEnabled
→VoiceChannel.State.isCameraEnabled
VoiceChannel.State.suppressed
→VoiceChannel.State.isSuppressed
ThreadChannel.archived
→ThreadChannel.isArchived
ThreadChannel.locked
→ThreadChannel.isLocked
Button.disabled
→Button.isDisabled
TextInput.required
→TextInput.isRequired
Embed.Field.inline
→Embed.Field.isInline
Emoji.requireColons
→Emoji.requiresColons
Emoji.managed
→Emoji.isManaged
Emoji.animated
→Emoji.isAnimated
Emoji.available
→Emoji.isAvailable
PartialEmoji.animated
→PartialEmoji.isAnimated
ApplicationCommandOption.required
→ApplicationCommandOption.isRequired
ApplicationCommandInteractionDataOption.focused
→ApplicationCommandInteractionDataOption.isFocused
Invite.temporary
→Invite.isTemporary
Message.Attachment.ephemeral
→Message.Attachment.isEphemeral
Message.Attachment.spoiler
→Message.Attachment.isSpoiler
ApplicationCommandPermissions.allowed
→ApplicationCommandPermissions.isAllowed
Role.managed
→Role.isManaged
Role.mentionable
→Role.isMentionable
GuildSticker.available
→GuildSticker.isAvailable
ClientUser.mfaEnabled
→ClientUser.isMfaEnabled
0.1.1-beta
Released on Sept. 24, 2023
New Features
Added method
Member.getRole()
Added method
Guild.getMember(name:)
Added method
Bot.once()
Added property
VoiceChannel.State.userId
Added property
VoiceChannel.State.guildId
Added property
VoiceChannel.State.member
Added property
User.status
Added property
User.activities
Added property
User.platform
Added property
User.isOnMobile
Added property
User.Activity.flags
Added enum
User.ActivityFlag
Added struct
User.Platform
. This contains information such as which platform the user is currently on as well as their status.
Bug Fixes
Fixed an issue where if a user left a voice channel and they were not in the cache, an error would occur.
Fixed an issue where property
VoiceChannel.members
would not return the proper amount of members.Fixed an issue where an error could occur due to an unhandled
.goingAway
WebSocket event.
Updated
(Breaking Change) Property
CacheManager.channels
has been removed. This caused an underlying issue where it was possible for variousMessage
properties/methods to error because of a missing value. This only affected users who had it disabled.(Breaking Change) Properties
Guild.mentionChannelAndRoles
andGuild.mentionBrowseChannels
have been moved toMarkdown
(Breaking Change) Removed struct
User.PresenceActivity
. Along with this change, its properties were converted into enum case associated values in enumUser.ActivityType
. This makes it a little easier to update your bot presence.Before:
bot.updatePresence(status: .dnd, activity: .init(User.ActivityType.game, name: "in the clouds"))
After:
bot.updatePresence(status: .dnd, activity: .game("in the clouds"))
Method
Bot.updatePresence()
no longerthrows
0.1.0-beta
Released on Sept. 15, 2023
New Features
Added
throw
ing of gateway errors.Added method
Guild.chunkMembers()
Added property
Guild.chunked
Added property
Guild.memberCount
Added property
ClientUser.bot
Added property
User.displayName
Added property
Message.nonce
Added property
Message.isMentioned
Added parameter
user
toEventListener.onReady()
Added method
EventListener.onRawGuildMemberUpdate()
Added enum case
Message.Edit.flags
Added struct
CacheManager
. This controls your bots caching capabilities. Completely disableUser
,Member
,GuildChannel
, orMessage
caching. Depending on your use case, this can reduce your bots memory footprint especially at scale. You can use the cache manager via parametercacheManager
inBot.init()
Bug Fixes
Fixed an issue where property
Member.premiumSince
was alwaysnil
Fixed a pre-release issue where thread related events weren't being dispatched.
Fixed a spelling error that prevented sharding from being enabled.
Updated
(Breaking Change) The following has been renamed:
Class
Discord
→Bot
Enum case
GatewayError.invalidSeq
→GatewayError.invalidSequence
(Breaking Change)
Bot.token
is no longer a property and can now be accessed via methodBot.token()
(Breaking Change)
Bot.updatePresence()
is no longer anasync
method.(Breaking Change) Parameter
maxMessagesCache
has been removed fromBot.init()
(replaced with parametercacheManager
).(Breaking Change) Removed
MediaChannel
. This was added a tad bit too early, we'll wait for further documentation. Along with this change,Guild.mediaChannels
, andChannelType.media
have been removed.(Breaking Change) Removed parameter
ignoreDms
fromBot.init()
. This was removed because intents provide more granular control of DMs. Even with it removed, you can still ignore DMs by excludingIntents.dmMessages
, in addition to the other DM related intents.Initial startup Guild Member Chunking has been removed. Prior to this update, if you had
Intents.guildPresences
enabled, all members for every guild would be cached. This would unnecessarily inflate memory usage. With it being removed, you can still opt-in to caching every member of a guild viaGuild.chunkMembers()
The exclusion of the
guildPresences
intent has been added toIntents.default
The associated value for enum case
Member.Edit.move
is nowVoiceChannel
The
EventListener.onReady()
event is now dispatched when all guilds have been cached. Unlike before where it would dispatch when all guilds and all its members were cached.With Linux support, Vapor and WebSocketKit have been added as dependencies.
0.0.14-beta
Released on Aug. 27, 2023
New Features
Added method
Messageable.deleteAllMessages()
Added parameter
style
toMarkdown.escape()
Added parameter
suppressEmbed
toMarkdown.maskedLink()
Added property
Role.isDefault
Added property
Role.isPremiumSubscriber
Added property
Role.unicodeEmoji
Added enum case
Role.Edit.unicodeEmoji
Added method
Role.clone()
Added property
Application.Team.Member.role
Added property
Application.roleConnectionsVerificationUrl
Added the following application flag enum cases (see updated #2):
Application.Flag.applicationAutoModerationRuleCreateBadge
Application.Flag.applicationCommandBadge
Added the following system channel flag enum cases (see updated #2):
SystemChannelFlag.suppressRoleSubscriptionPurchaseNotifications
SystemChannelFlag.suppressRoleSubscriptionPurchaseNotificationReplies
Added enum
Application.Team.MemberRole
Updated
(Breaking Change) Parameter
emoji
inGuild.createRole()
has been renamed tounicodeEmoji
(Breaking Change) The following have been renamed to provide more consistency throughout the library:
Enum
Application.ApplicationFlag
→Application.Flag
Enum
Message.Flags
→Message.Flag
Enum
SystemChannelFlags
→SystemChannelFlag
Enum
User.PublicUserFlags
→User.Flag
. Along with this change, caseUser.Flag.none
has been removed.Property
User.publicUserFlags
→User.flags
and is no longer an optional type.
(Breaking Change) The following guild feature enum cases have been removed:
Guild.Feature.monetizationEnabled
Guild.Feature.privateThreads
Guild.Feature.textInVoiceEnabled
0.0.13-beta
Released on Aug.24, 2023
New Features
Added property
GuildChannel.permissionsSynced
Bug Fixes
Fixed an issue where an error would occur if a voice channel was created.
Updated
Webhook
is now astruct
instead of aclass
PermissionOverwrites
now conforms to protocolEquatable
0.0.12-beta
Released on Aug. 16, 2023
New Features
Added method
Discord.getEmoji()
Added method
User.mentionedIn()
Added method
Member.mentionedIn()
Added property
Member.dmChannel
Added property
Guild.mentionChannelAndRoles
Added property
Guild.mentionBrowseChannels
Updated
(Breaking Change) Property
Member.isPending
is no longer an optional type.
0.0.11-beta
Released on Aug. 9, 2023
New Features
Added property
Color.teal
Added method
Guild.getStageInstance()
Added method
Guild.getVoiceState()
Added case
Guild.Edit.safetyAlertsChannel
Added case
Guild.Edit.community
Added case
Guild.Edit.discoverable
Added case
Guild.Edit.invitesDisabled
Added case
Guild.Edit.raidAlertsDisabled
Added case
Message.Flags.suppressNotifications
Added case
Message.Flags.isVoiceMessage
Added parameter
silent
toMessageable.send()
Added class
MediaChannel
. Discord stated that this new channel type is still in beta, so although it's implemented, specific features might not function as intended until final release. With the addition of the class, the following has also been added:Property
Guild.mediaChannels
Case
ChannelType.guildMedia
Bug Fixes
Fixed an issue where an error would occur if someone left a voice channel.
Fixed an issue where property
ForumChannel.lastMessageId
was not being updated when a new thread was created.Fixed an issue where various errors would occur if a guild was edited. This relates to the following properties:
Guild.icon
Guild.splash
Guild.discoverySplash
Guild.banner
Updated
Property
User.description
now displays only the users name instead of their name and discriminator if they have been migrated to the new Discord naming system.Property
User.defaultAvatarUrl
now distinguishes between migrated and non-migrated users.Property
GuildChannel.mention
now checks whether the channel type is a category. If so, the hashtag is no longer included because categories cannot be properly mentioned.
0.0.10-beta
Released on Jul. 31, 2023
New Features
Added method
Interaction.respondWithAutocomplete()
. This change enables the ability to dynamically generate responses compared to the previous method where only static responses could be provided viasuggestions
(see updated).Added parameter
spoiler
toFile.init()
Added property
File.spoiler
Added property
Message.Attachment.spoiler
Updated
(Breaking Change)
ApplicationCommandOption
Removed parameter
suggestions
from the.init()
Removed property
ApplicationCommandOption.suggestions
0.0.9-beta
Released on Jul. 10, 2023
New Features
Added the ability to reset a
Role
color and icon back to its default state.
Updated
(Breaking Change) Parameter
with
in methodDiscord.createDm()
now only acceptsUser
instead ofSnowflake
.
0.0.8-alpha
Released on Jun. 28, 2023
New Features
Added property
PermissionOverwrites.type
.Structures
Asset
andColor
now conform to protocolHashable
.
Bug Fixes
Fixed an issue where
PermissionOverwrites.init()
could error if theMember
that was passed to thefor
parameter was not found in the internal cache.
Updated
Property
Message.Reference.failIfNotExists
was changed to a variable instead of a constant.(Breaking Change)
PermissionOverwrites
Property
PermissionOverwrites.target
was renamed toid
and is now of typeSnowflake
.Parameter
id
have been added toPermissionOverwrites.init()
. Thefor
parameter is now of typeOverwriteType
.PermissionOverwrites.init()
is no longer failable. With this change, the following no longer returns optional values:GuildChannel.overwrites
CategoryChannel.overwrites
TextChannel.overwrites
ForumChannel.overwrites
VoiceChannel.overwrites
ThreadChannel.overwrites
0.0.7-alpha
Released on Jun. 23, 2023
New Features
Added property
Discord.channels
.Added property
Discord.voiceStates
.Added property
Member.mutualGuilds
.Added protocol
Downloadable
. All conforming objects now have a.download()
method. This provides an easy way to convert URLs (such as images) into aFile
. With this addition, the following objects now conform to that protocol:Asset
Message.Attachment
(see updated)Embed.Image
Embed.Thumbnail
Emoji
Bug Fixes
Fixed method
Discord.getMember()
sometimes returning the wrong member.Fixed event listener
onGuildMemberRemove()
sometimes dispatching the wrong member.
Updated
(Breaking Change) Added parameter
in
to methodDiscord.getMember()
.(Breaking Change) Method
Message.Attachment.toFile()
was renamed toMessage.Attachment.download()
.
0.0.6-alpha
Released on Jun. 19, 2023
New Features
Added method
Asset.download()
.Added parameter
ignoreDms
toDiscord.init()
.Added the following cases for
Permissions
:Permissions.useExternalSoundboard
Permissions.sendVoiceMessages
Updated
The following have been enabled in property
Permissions.default
:Permissions.useVoiceActivityDetection
Permissions.useSoundboard
Permissions.useExternalSoundboard
Permissions.sendVoiceMessages
Miscellaneous
Documentation is now available.
0.0.5-alpha
Released on June 13, 2023.
New Features
Added function
channelLink()
.Added function
messageLink()
.Added property
Guild.categories
.Added property
GuildChannel.guild
.Added property
GuildChannel.guildId
.Added property
CategoryChannel.channels
.Added property
categoryId
to all channel types that conform to protocolGuildChannel
.Added init
Color(hex:)
.
Bug Fixes
Fixed an issue where channels that have a
category
property would returnnil
even when they belonged to a category.Fixed an issue where audit logs were not being filtered by their
actionType
even when an action type was set.Fixed an issue where the following methods would error if a message had a reaction:
Messageable.history()
Messageable.requestMessage()
0.0.4-alpha
Released on June 7, 2023.
New Features
Added property
ApplicationCommand.mention
.Added property
Message.mention
(see updated).Added struct
Markdown
. This contains all methods related to markdowns. The following has been added:Markdown.blockQuote()
Markdown.bold()
Markdown.codeBlock()
Markdown.customEmoji()
Markdown.escape()
Markdown.header()
Markdown.inlineCode()
Markdown.list()
Markdown.maskedLink()
Markdown.mentionChannel()
Markdown.mentionRole()
Markdown.mentionSlashCommand()
Markdown.mentionUser()
Markdown.spoiler()
Markdown.suppressLinkEmbed()
Markdown.strikethrough()
Markdown.underline()
Bug Fixes
Fixed property
Emoji.url
returning a .png URL even when the emoji was animated (.gif).
Updated
Property
GuildChannel.jumpUrl
andMessage.jumpUrl
now returns a suppressed link. With the Discord app update, messages that contain channel/message links are displayed as mentions. This changes it so that.jumpUrl
and.mention
have separate use cases.With the addition of
Markdown
, the following has been changed:(Breaking Change) Function
clean()
was renamed toescape
and is now underMarkdown.escape()
. This also comes with a new parameter named:ignoreUrls
.(Breaking Change) Function
formatTimestamp()
was renamed totimestamp
and is now underMarkdown.timestamp()
.(Breaking Change) Enum
TimestampStyle
is now underMarkdown.TimestampStyle
.
0.0.3-alpha
Released on June 1, 2023.
New Features
Added method
Discord.waitUntilReady()
.Added method
File.download()
.
Bug Fixes
Fixed event listener
onReady()
not being dispatched when certain intents were missing.Fixed the possibility that
VoiceChannel.State
(Guild.voiceStates
) wouldn't' be fully updated.Fixed property
Guild.discoverySplash
returningnil
even if a discovery splash was present.Fixed property
Guild.splash
not being updated.Fixed method
ScheduledEvent.users()
error when called.
Updated
(Breaking Change) Method
Guild.bans()
parametersbefore
andafter
are now of typeDate
.(Breaking Change) Method
Guild.bans()
return type is nowGuild.AsyncBans
.(Breaking Change) Method
ScheduledEvent.users()
parametersbefore
andafter
are now of typeDate
.(Breaking Change) Method
ScheduledEvent.users()
return type is nowScheduledEvent.AsyncUsers
.Various documentation improvements. Added documentation that was missing and corrected typos.
0.0.2-alpha
Released on May 27, 2023.
New Features
Added function
getVariable()
.Added function
oauth2Url()
.Added method
Array.chunked()
.Added property
Guild.safetyAlertsChannelId
.Added property
Discord.emojis
.Added case
Guild.Feature.raidAlertsDisabled
.Added enum
OAuth2Scopes
(see updated).
Bug Fixes
Fixed
Embed.clear()
not removing the timestamp.Fixed
PartialInvite.inviter
error when missing inviter.
Updated
Function
clean()
now escapes bullet points and headers.AutoModerationRule
(Breaking Change) Renamed
AutoModerationRule.TriggerData
toMetadata
.(Breaking Change) Renamed
AutoModerationRule.Edit.triggers
tometadata
.Added
AutoModerationRule.metadata
. This now houses data such askeywordFilter
,presets
, etc.Added
AutoModerationRule.Metadata.mentionRaidProtectionEnabled
.Added
AutoModerationRule.Metadata
documentation.(Breaking Change) Removed
AutoModerationRule.keywordFilter
.(Breaking Change) Removed
AutoModerationRule.presets
.(Breaking Change) Removed parameter
mentionTotalLimit
fromAutoModerationRule.Metadata
.
(Breaking Change) Parameter
triggerData
renamed tometadata
in methodGuild.createAutoModerationRule()
.With the addition of
OAuth2Scopes
, the following has been updated:(Breaking Change) Property
Application.InstallParams.scopes
is now of typeSet<OAuth2Scopes>
.(Breaking Change) Property
Guild.Integration.scopes
is now of typeSet<OAuth2Scopes>
.
Last updated