🗂️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.expiresAdded property
Message.Attachment.issuedAdded property
Message.Attachment.signature
Added property
ThreadChannel.ownerIdAdded parameter
clearCachetoBot.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
timeoutinUI.init()happened to be below 0, its default value is now set to 0 instead of theUI.init()default value. This means theUI.onTimeoutclosure is immediately executed, unlike before where it would wait 120 seconds.
0.1.3-beta
New Features
Released on Oct. 8, 2023
Added parameter
platformtoEventListener.onPresenceUpdate()Implementation of premium app subscriptions
Added struct
Application.SkuAdded enum
Application.SkuTypeAdded enum
Application.SkuFlagAdded struct
Application.EntitlementAdded enum
Application.EntitlementTypeAdded property
Interaction.entitlementsAdded method
Interaction.respondWithPremiumRequired()Added enum case
InteractionCallbackType.premiumRequiredAdded 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.memberscould 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
activitiesinEventListener.onPresenceUpdate()is longer an optional type.
0.1.2-beta
Released on Sept. 29, 2023
New Features
Added property
Message.customEmojisAdded property
Markdown.mentionServerGuideAdded method
EventListener.onDisconnect()Added method
Bot.run()Added method
Bot.close()Added struct
SelectMenu.DefaultValueAdded property
SelectMenu.defaultValuesAdded parameter
defaultValuestoSelectMenu.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 anasyncmethod, 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.usersis now of typeSet<User>(Breaking Change) The following have been renamed:
EventListener.init(name:isEnabled)→EventListener.init(name:enabled)SelectMenu.MenuType.channels→SelectMenu.MenuType.channelSelectMenu.disabled→SelectMenu.isDisabledSelectMenu.Option.default→SelectMenu.Option.isDefaultGuild.chunked→Guild.isChunkedAsset.animated→Asset.isAnimatedAutoModerationRule.enabled→AutoModerationRule.isEnabledForumChannel.Tag.moderated→ForumChannel.Tag.isModeratedVoiceChannel.State.guildDeafened→VoiceChannel.State.isGuildDeafenedVoiceChannel.State.guildMuted→VoiceChannel.State.isGuildMutedVoiceChannel.State.selfDeafened→VoiceChannel.State.isSelfDeafenedVoiceChannel.State.selfMuted→VoiceChannel.State.isSelfMutedVoiceChannel.State.streaming→VoiceChannel.State.isStreamingVoiceChannel.State.cameraEnabled→VoiceChannel.State.isCameraEnabledVoiceChannel.State.suppressed→VoiceChannel.State.isSuppressedThreadChannel.archived→ThreadChannel.isArchivedThreadChannel.locked→ThreadChannel.isLockedButton.disabled→Button.isDisabledTextInput.required→TextInput.isRequiredEmbed.Field.inline→Embed.Field.isInlineEmoji.requireColons→Emoji.requiresColonsEmoji.managed→Emoji.isManagedEmoji.animated→Emoji.isAnimatedEmoji.available→Emoji.isAvailablePartialEmoji.animated→PartialEmoji.isAnimatedApplicationCommandOption.required→ApplicationCommandOption.isRequiredApplicationCommandInteractionDataOption.focused→ApplicationCommandInteractionDataOption.isFocusedInvite.temporary→Invite.isTemporaryMessage.Attachment.ephemeral→Message.Attachment.isEphemeralMessage.Attachment.spoiler→Message.Attachment.isSpoilerApplicationCommandPermissions.allowed→ApplicationCommandPermissions.isAllowedRole.managed→Role.isManagedRole.mentionable→Role.isMentionableGuildSticker.available→GuildSticker.isAvailableClientUser.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.userIdAdded property
VoiceChannel.State.guildIdAdded property
VoiceChannel.State.memberAdded property
User.statusAdded property
User.activitiesAdded property
User.platformAdded property
User.isOnMobileAdded property
User.Activity.flagsAdded enum
User.ActivityFlagAdded 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.memberswould not return the proper amount of members.Fixed an issue where an error could occur due to an unhandled
.goingAwayWebSocket event.
Updated
(Breaking Change) Property
CacheManager.channelshas been removed. This caused an underlying issue where it was possible for variousMessageproperties/methods to error because of a missing value. This only affected users who had it disabled.(Breaking Change) Properties
Guild.mentionChannelAndRolesandGuild.mentionBrowseChannelshave 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 Linux support 🥳.
Added
throwing of gateway errors.Added method
Guild.chunkMembers()Added property
Guild.chunkedAdded property
Guild.memberCountAdded property
ClientUser.botAdded property
User.displayNameAdded property
Message.nonceAdded property
Message.isMentionedAdded parameter
usertoEventListener.onReady()Added method
EventListener.onRawGuildMemberUpdate()Added enum case
Message.Edit.flagsAdded struct
CacheManager. This controls your bots caching capabilities. Completely disableUser,Member,GuildChannel, orMessagecaching. Depending on your use case, this can reduce your bots memory footprint especially at scale. You can use the cache manager via parametercacheManagerinBot.init()
Bug Fixes
Fixed an issue where property
Member.premiumSincewas alwaysnilFixed 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→BotEnum case
GatewayError.invalidSeq→GatewayError.invalidSequence
(Breaking Change)
Bot.tokenis no longer a property and can now be accessed via methodBot.token()(Breaking Change)
Bot.updatePresence()is no longer anasyncmethod.(Breaking Change) Parameter
maxMessagesCachehas 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.mediahave been removed.(Breaking Change) Removed parameter
ignoreDmsfromBot.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.guildPresencesenabled, 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
guildPresencesintent has been added toIntents.defaultThe associated value for enum case
Member.Edit.moveis nowVoiceChannelThe
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
styletoMarkdown.escape()Added parameter
suppressEmbedtoMarkdown.maskedLink()Added property
Role.isDefaultAdded property
Role.isPremiumSubscriberAdded property
Role.unicodeEmojiAdded enum case
Role.Edit.unicodeEmojiAdded method
Role.clone()Added property
Application.Team.Member.roleAdded property
Application.roleConnectionsVerificationUrlAdded the following application flag enum cases (see updated #2):
Application.Flag.applicationAutoModerationRuleCreateBadgeApplication.Flag.applicationCommandBadge
Added the following system channel flag enum cases (see updated #2):
SystemChannelFlag.suppressRoleSubscriptionPurchaseNotificationsSystemChannelFlag.suppressRoleSubscriptionPurchaseNotificationReplies
Added enum
Application.Team.MemberRole
Updated
(Breaking Change) Parameter
emojiinGuild.createRole()has been renamed tounicodeEmoji(Breaking Change) The following have been renamed to provide more consistency throughout the library:
Enum
Application.ApplicationFlag→Application.FlagEnum
Message.Flags→Message.FlagEnum
SystemChannelFlags→SystemChannelFlagEnum
User.PublicUserFlags→User.Flag. Along with this change, caseUser.Flag.nonehas been removed.Property
User.publicUserFlags→User.flagsand is no longer an optional type.
(Breaking Change) The following guild feature enum cases have been removed:
Guild.Feature.monetizationEnabledGuild.Feature.privateThreadsGuild.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
Webhookis now astructinstead of aclassPermissionOverwritesnow 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.dmChannelAdded property
Guild.mentionChannelAndRolesAdded property
Guild.mentionBrowseChannels
Updated
(Breaking Change) Property
Member.isPendingis no longer an optional type.
0.0.11-beta
Released on Aug. 9, 2023
New Features
Added property
Color.tealAdded method
Guild.getStageInstance()Added method
Guild.getVoiceState()Added case
Guild.Edit.safetyAlertsChannelAdded case
Guild.Edit.communityAdded case
Guild.Edit.discoverableAdded case
Guild.Edit.invitesDisabledAdded case
Guild.Edit.raidAlertsDisabledAdded case
Message.Flags.suppressNotificationsAdded case
Message.Flags.isVoiceMessageAdded parameter
silenttoMessageable.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.mediaChannelsCase
ChannelType.guildMedia
Bug Fixes
Fixed an issue where an error would occur if someone left a voice channel.
Fixed an issue where property
ForumChannel.lastMessageIdwas 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.iconGuild.splashGuild.discoverySplashGuild.banner
Updated
Property
User.descriptionnow displays only the users name instead of their name and discriminator if they have been migrated to the new Discord naming system.Property
User.defaultAvatarUrlnow distinguishes between migrated and non-migrated users.Property
GuildChannel.mentionnow 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
spoilertoFile.init()Added property
File.spoilerAdded property
Message.Attachment.spoiler
Updated
(Breaking Change)
ApplicationCommandOptionRemoved parameter
suggestionsfrom the.init()Removed property
ApplicationCommandOption.suggestions
0.0.9-beta
Released on Jul. 10, 2023
New Features
Added the ability to reset a
Rolecolor and icon back to its default state.
Updated
(Breaking Change) Parameter
within methodDiscord.createDm()now only acceptsUserinstead ofSnowflake.
0.0.8-alpha
Released on Jun. 28, 2023
New Features
Added property
PermissionOverwrites.type.Structures
AssetandColornow conform to protocolHashable.
Bug Fixes
Fixed an issue where
PermissionOverwrites.init()could error if theMemberthat was passed to theforparameter was not found in the internal cache.
Updated
Property
Message.Reference.failIfNotExistswas changed to a variable instead of a constant.(Breaking Change)
PermissionOverwritesProperty
PermissionOverwrites.targetwas renamed toidand is now of typeSnowflake.Parameter
idhave been added toPermissionOverwrites.init(). Theforparameter is now of typeOverwriteType.PermissionOverwrites.init()is no longer failable. With this change, the following no longer returns optional values:GuildChannel.overwritesCategoryChannel.overwritesTextChannel.overwritesForumChannel.overwritesVoiceChannel.overwritesThreadChannel.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:AssetMessage.Attachment(see updated)Embed.ImageEmbed.ThumbnailEmoji
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
into 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
ignoreDmstoDiscord.init().Added the following cases for
Permissions:Permissions.useExternalSoundboardPermissions.sendVoiceMessages
Updated
The following have been enabled in property
Permissions.default:Permissions.useVoiceActivityDetectionPermissions.useSoundboardPermissions.useExternalSoundboardPermissions.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
categoryIdto all channel types that conform to protocolGuildChannel.Added init
Color(hex:).
Bug Fixes
Fixed an issue where channels that have a
categoryproperty would returnnileven when they belonged to a category.Fixed an issue where audit logs were not being filtered by their
actionTypeeven 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.urlreturning a .png URL even when the emoji was animated (.gif).
Updated
Property
GuildChannel.jumpUrlandMessage.jumpUrlnow returns a suppressed link. With the Discord app update, messages that contain channel/message links are displayed as mentions. This changes it so that.jumpUrland.mentionhave separate use cases.With the addition of
Markdown, the following has been changed:(Breaking Change) Function
clean()was renamed toescapeand is now underMarkdown.escape(). This also comes with a new parameter named:ignoreUrls.(Breaking Change) Function
formatTimestamp()was renamed totimestampand is now underMarkdown.timestamp().(Breaking Change) Enum
TimestampStyleis 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.discoverySplashreturningnileven if a discovery splash was present.Fixed property
Guild.splashnot being updated.Fixed method
ScheduledEvent.users()error when called.
Updated
(Breaking Change) Method
Guild.bans()parametersbeforeandafterare now of typeDate.(Breaking Change) Method
Guild.bans()return type is nowGuild.AsyncBans.(Breaking Change) Method
ScheduledEvent.users()parametersbeforeandafterare 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.invitererror when missing inviter.
Updated
Function
clean()now escapes bullet points and headers.AutoModerationRule(Breaking Change) Renamed
AutoModerationRule.TriggerDatatoMetadata.(Breaking Change) Renamed
AutoModerationRule.Edit.triggerstometadata.Added
AutoModerationRule.metadata. This now houses data such askeywordFilter,presets, etc.Added
AutoModerationRule.Metadata.mentionRaidProtectionEnabled.Added
AutoModerationRule.Metadatadocumentation.(Breaking Change) Removed
AutoModerationRule.keywordFilter.(Breaking Change) Removed
AutoModerationRule.presets.(Breaking Change) Removed parameter
mentionTotalLimitfromAutoModerationRule.Metadata.
(Breaking Change) Parameter
triggerDatarenamed tometadatain methodGuild.createAutoModerationRule().With the addition of
OAuth2Scopes, the following has been updated:(Breaking Change) Property
Application.InstallParams.scopesis now of typeSet<OAuth2Scopes>.(Breaking Change) Property
Guild.Integration.scopesis now of typeSet<OAuth2Scopes>.
Last updated