Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Releases: Defxult/Discord.swift

0.1.3-beta

08 Oct 16:51
Compare
Choose a tag to compare
0.1.3-beta Pre-release
Pre-release

New Features

  • Added parameter platform to EventListener.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 in EventListener.onPresenceUpdate() is longer an optional type.

0.1.2-beta

29 Sep 13:08
fa53201
Compare
Choose a tag to compare
0.1.2-beta Pre-release
Pre-release

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 to SelectMenu.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 longer throws, is not an async method, and does not block to maintain the connection. Method Bot.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 use Bot.run() and to release the block, use Bot.close()
  • (Breaking Change) Property Bot.users is now of type Set<User>
  • (Breaking Change) The following have been renamed:
    • EventListener.init(name:isEnabled)EventListener.init(name:enabled)
    • SelectMenu.MenuType.channelsSelectMenu.MenuType.channel
    • SelectMenu.disabledSelectMenu.isDisabled
    • SelectMenu.Option.defaultSelectMenu.Option.isDefault
    • Guild.chunkedGuild.isChunked
    • Asset.animatedAsset.isAnimated
    • AutoModerationRule.enabledAutoModerationRule.isEnabled
    • ForumChannel.Tag.moderatedForumChannel.Tag.isModerated
    • VoiceChannel.State.guildDeafenedVoiceChannel.State.isGuildDeafened
    • VoiceChannel.State.guildMutedVoiceChannel.State.isGuildMuted
    • VoiceChannel.State.selfDeafenedVoiceChannel.State.isSelfDeafened
    • VoiceChannel.State.selfMutedVoiceChannel.State.isSelfMuted
    • VoiceChannel.State.streamingVoiceChannel.State.isStreaming
    • VoiceChannel.State.cameraEnabledVoiceChannel.State.isCameraEnabled
    • VoiceChannel.State.suppressedVoiceChannel.State.isSuppressed
    • ThreadChannel.archivedThreadChannel.isArchived
    • ThreadChannel.lockedThreadChannel.isLocked
    • Button.disabledButton.isDisabled
    • TextInput.requiredTextInput.isRequired
    • Embed.Field.inlineEmbed.Field.isInline
    • Emoji.requireColonsEmoji.requiresColons
    • Emoji.managedEmoji.isManaged
    • Emoji.animatedEmoji.isAnimated
    • Emoji.availableEmoji.isAvailable
    • PartialEmoji.animatedPartialEmoji.isAnimated
    • ApplicationCommandOption.requiredApplicationCommandOption.isRequired
    • ApplicationCommandInteractionDataOption.focusedApplicationCommandInteractionDataOption.isFocused
    • Invite.temporaryInvite.isTemporary
    • Message.Attachment.ephemeralMessage.Attachment.isEphemeral
    • Message.Attachment.spoilerMessage.Attachment.isSpoiler
    • ApplicationCommandPermissions.allowedApplicationCommandPermissions.isAllowed
    • Role.managedRole.isManaged
    • Role.mentionableRole.isMentionable
    • GuildSticker.availableGuildSticker.isAvailable
    • ClientUser.mfaEnabledClientUser.isMfaEnabled

0.1.1-beta

24 Sep 19:17
Compare
Choose a tag to compare
0.1.1-beta Pre-release
Pre-release

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 various Message properties/methods to error because of a missing value. This only affected users who had it disabled.
  • (Breaking Change) Properties Guild.mentionChannelAndRoles and Guild.mentionBrowseChannels have been moved to Markdown
  • (Breaking Change) Removed struct User.PresenceActivity. Along with this change, its properties were converted into enum case associated values in enum User.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 longer throws

0.1.0-beta

15 Sep 15:01
Compare
Choose a tag to compare
0.1.0-beta Pre-release
Pre-release

New Features

  • Added Linux support 🥳.
  • Added throwing 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 to EventListener.onReady()
  • Added method EventListener.onRawGuildMemberUpdate()
  • Added enum case Message.Edit.flags
  • Added struct CacheManager. This controls your bots caching capabilities. Completely disable User, Member, GuildChannel, or Message caching. Depending on your use case, this can reduce your bots memory footprint especially at scale. You can use the cache manager via parameter cacheManager in Bot.init()

Bug Fixes

  • Fixed an issue where property Member.premiumSince was always nil
  • 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 DiscordBot
    • Enum case GatewayError.invalidSeqGatewayError.invalidSequence
  • (Breaking Change) Bot.token is no longer a property and can now be accessed via method Bot.token()
  • (Breaking Change) Bot.updatePresence() is no longer an async method.
  • (Breaking Change) Parameter maxMessagesCache has been removed from Bot.init() (replaced with parameter cacheManager).
  • (Breaking Change) Removed MediaChannel. This was added a tad bit too early. We'll wait for further documentation. Along with this change, Guild.mediaChannels, and ChannelType.media have been removed.
  • (Breaking Change) Removed parameter ignoreDms from Bot.init(). This was removed because intents provide more granular control of DMs. Even with it removed, you can still ignore DMs by excluding Intents.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 via Guild.chunkMembers()
  • The exclusion of the guildPresences intent has been added to Intents.default
  • The associated value for enum case Member.Edit.move is now VoiceChannel
  • 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

27 Aug 16:19
Compare
Choose a tag to compare
0.0.14-beta Pre-release
Pre-release

New Features

  • Added method Messageable.deleteAllMessages()
  • Added parameter style to Markdown.escape()
  • Added parameter suppressEmbed to Markdown.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 in Guild.createRole() has been renamed to unicodeEmoji
  • (Breaking Change) The following have been renamed to provide more consistency throughout the library:
    • Enum Application.ApplicationFlagApplication.Flag
    • Enum Message.FlagsMessage.Flag
    • Enum SystemChannelFlagsSystemChannelFlag
    • Enum User.PublicUserFlagsUser.Flag. Along with this change, case User.Flag.none has been removed.
    • Property User.publicUserFlagsUser.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

24 Aug 17:00
Compare
Choose a tag to compare
0.0.13-beta Pre-release
Pre-release

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 a struct instead of a class
  • PermissionOverwrites now conforms to protocol Equatable

0.0.12-beta

16 Aug 15:22
Compare
Choose a tag to compare
0.0.12-beta Pre-release
Pre-release

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

09 Aug 17:27
Compare
Choose a tag to compare
0.0.11-beta Pre-release
Pre-release

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 to Messageable.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

31 Jul 15:28
Compare
Choose a tag to compare
0.0.10-beta Pre-release
Pre-release

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 via suggestions (see updated).
  • Added parameter spoiler to File.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

10 Jul 14:58
Compare
Choose a tag to compare
0.0.9-beta Pre-release
Pre-release

New Features

  • Added the ability to reset a Role color and icon back to its default state.

Updated

  • (Breaking Change) Parameter with in method Discord.createDm() now only accepts User instead of Snowflake.