This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
Releases: Defxult/Discord.swift
Releases · Defxult/Discord.swift
0.1.3-beta
New Features
- 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()
- Added struct
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
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()
- Added property
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
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
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"))
- Before:
- Method
Bot.updatePresence()
no longerthrows
0.1.0-beta
New Features
- Added Linux support 🥳.
- 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
- Class
- (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
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.
- Enum
- (Breaking Change) The following guild feature enum cases have been removed:
Guild.Feature.monetizationEnabled
Guild.Feature.privateThreads
Guild.Feature.textInVoiceEnabled
0.0.13-beta
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
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
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
- Property
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
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
- Removed parameter
0.0.9-beta
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
.