8000 Releases · DiscordBM/DiscordBM · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Releases: DiscordBM/DiscordBM

v1.6.0 - GatewayEventHandler functions can throw now

02 Nov 06:23
7758d76
Compare
Choose a tag to compare

GatewayEventHandler functions can throw too now, so you don't have to use an explicit do/catch.
Upon a thrown error, the GatewayEventHandler will log the error while including the function name which threw the error.

The README has been updated to reflect this. As an example:

struct EventHandler: GatewayEventHandler {
    let event: Gateway.Event
    let client: any DiscordClient

    func onMessageCreate(_ payload: Gateway.MessageCreate) async throws {
        let response = try await client.createMessage(
            channelId: payload.channel_id,
            payload: .init(content: "Got a message: '\(payload.content)'")
        )

        let message = try response.decode()
    }
}

The function can now be marked as throws.

This previously needed a do/catch:

struct EventHandler: GatewayEventHandler {
    let event: Gateway.Event
    let client: any DiscordClient

    func onMessageCreate(_ payload: Gateway.MessageCreate) async {
        do {
            let response = try await client.createMessage(
                channelId: payload.channel_id,
                payload: .init(content: "Got a message: '\(payload.content)'")
            )

            let message = try response.decode()
        } catch {
            print("We got an error! \(error)")
        }
    }
}

Full Changelog: v1.5.0...v1.6.0

v1.5.0 - Support monetization APIs + update with Discord changes

29 Oct 21:53
d12398a
Compare
Choose a tag to compare

Update with Discord docs till October 28 2023

  • AuditLog.Entry.Action.memberRoleUpdate(integration_type: Integration.Kind) now is (integration_type: Integration.Kind?). The type of integration_type has been changed to be Optional.
    • This is technically a breaking change, but considering that i deemed it low-impact, and a workaround would have been troublesome, i proceeded with the change.
  • 3 new Gateway events:
    • entitlementCreate(Entitlement)
    • entitlementUpdate(Entitlement)
    • entitlementDelete(Entitlement)
  • 5 new DiscordClient endpoints:
    • updateOwnApplication(payload:)
    • listEntitlements(appId:userId:skuIds:before:after:limit:guildId:excludeEnded:)
    • createTestEntitlement(appId:payload:)
    • deleteTestEntitlement(appId:entitlementId:)
    • listSKUs(appId:)
  • DiscordCache stores entitlements now.
  • Interaction now contains the entitlements.
  • You can create premiumRequired() as a InteractionResponse.
  • JSONErrorCode has 2 new cases:
    • anEntitlementHasAlreadyBeenGrantedForThisResource
    • invalidSKU
  • Other minor changes. See full change log below for more info.

Full Changelog: v1.4.0...v1.5.0

v1.4.0 - Some Fixes, DiscordBM Swift 5.9 release delayed

24 Sep 18:18
a949bd5
Compare
Choose a tag to compare

DiscordBM release to move to requiring Swift 5.9 has been delayed as i need to workaround some macro issues first.
The release might be delayed up to when Swift 5.9.1 is released.

What's Changed

  • Fix bot.updatePresence(payload:) by @codemeister64 in #57
  • Rename/deprecate startThreadInForumChannel to startThreadInForumOrMediaChannel.
    • The response contains the returned message too now.

New Contributors

  • @codemeister64 made their first contribution in #57

Full Changelog: v1.3.1...v1.4.0

v1.3.1 - Next release will require Swift 5.9+

18 Sep 20:36
Compare
Choose a tag to compare

Next release will require Swift 5.9+

Next release will make heavy use of macros to for a decent amount of better user experience as well as some performance boosts.
I have decided the library will not support Swift versions lower than 5.9 as soon as the macro is merged.

What's Changed

  • Increase default backoff maxAllowed from 5 to 6 seconds.
    • I have a personal feeling from my experience that a 6s maxAllowed will be decently better in practice, as 5s is exactly the age of a bucket and a second more could help users not notice rate-limit problems even less.
  • Some other minor refinements such as more documentation.

Full Changelog: v1.3.0...v1.3.1

v1.3.0 - Updates, fixes and refinements

03 Sep 15:39
Compare
Choose a tag to compare

What's Changed

  • Correct DiscordClient.createFollowupMessage() payload type from Payloads.InteractionResponse to Payloads.ExecuteWebhook.
    • This change should technically only happen in major versions as it's not one of the exempt technically-breaking changes that DiscordBM reserves the right to make, but the function wasn't working before anyway so the change is justified.
  • Reaction now contains much more info (f54a928).
  • AuditLog.Action's memberKick case now contains integration_type: Integration.Kind.
  • AuditLog.Action's memberRoleUpdate case contained integration_type: Integration.Kind?. integration_type is no longer of an Optional type.
  • JSONErrorCode has a new userCannotUseBurstReactions.
  • Team contains a new var role: Role. Role is an enum with cases declared as admin, developer or readOnly. owner While being a role in practice, it will still not appear as a case in Role.

Full Changelog: v1.2.0...v1.3.0

v1.2.0

20 Aug 10:36
2b745f0
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.1.2...v1.2.0

v1.1.2 - Fix permission-checking functions for public/private threads

21 Jul 13:12
Compare
Choose a tag to compare

Fix permission-checking functions for public/private threads

The below list of functions of Gateway.GuildCreate are affected by this change:

  • memberHasPermissions(member:userId:channelId:permissions:)
  • memberHasGuildPermission(member:userId:permission:)
  • userHasPermissions(userId:channelId:permissions:)
  • userHasGuildPermission(userId:permission:)

Full Changelog: v1.1.1...v1.1.2

v1.1.1 - Better `DiscordColor`s matching Apple's HIG + Update with Discord docs

14 Jul 15:09
Compare
Choose a tag to compare

Fixing v1.1.0 release

Some commits were stuck on my computer.

What's Changed

  • Better static func/vars for getting colors, according to Apple's HIG.
  • Add 2 new API endpoints: updateGuildOnboarding(guildId:reason:payload:) and getOwnApplication().
  • Updated an existing API endpoint: listOwnGuilds(before:after:limit:) -> listOwnGuilds(before:after:limit:withCounts:).
  • Add a new CDN endpoint: getCDNUserAvatarDecoration(userId:avatarDecoration:).
  • Fixed an issue decoding optional arrays of _ToleratedDecode enums.
  • New fields in DiscordApplication and PartialApplication: guild: PartialGuild?, approximate_guild_count: Int?.
  • New field in DiscordUser, PartialUser and MentionUser: avatar_decoration: String?.
  • New AuditLog.Entry.Action cases: creatorMonetizationRequestCreated and creatorMonetizationTermsAccepted.
  • Better decode tolerance in AuditLog.Entry.Action.
  • New DiscordChannel.Attachment.Flag type containing 1 case: isRemix.
  • New field in DiscordChannel.Attachment: flags: IntBitField<Flag>.
  • New JSONErrorCode cases: cannotEnableOnboardingRequirementsAreNotMet and cannotUpdateOnboardingWhileBelowRequirements.
  • New MessageReactionAdd field: message_author_id: UserSnowflake?.
  • New Guild.Onboarding.Mode type containing 2 cases: onboardingDefault and onboardingAdvanced.
  • New field in Guild.Onboarding: mode: Mode.
  • New field in Payloads.CreateGuildChannel: default_forum_layout: DiscordChannel.ForumLayout?.
  • New Role.Flag type containing 1 case: inPrompt.
  • New field in Role: flags: IntBitField<Flag>.

Full Changelog: v1.0.0...v1.1.1

v1.1.0 - Better `DiscordColor`s matching Apple's HIG + Update with Discord docs

14 Jul 14:50
77f233b
Compare
Choose a tag to compare

What's Changed

  • Better static func/vars for getting colors, according to Apple's HIG.
  • Add 2 new API endpoints: updateGuildOnboarding(guildId:reason:payload:) and getOwnApplication().
  • Updated an existing API endpoint: listOwnGuilds(before:after:limit:) -> listOwnGuilds(before:after:limit:withCounts:).
  • Add a new CDN endpoint: getCDNUserAvatarDecoration(userId:avatarDecoration:).
  • Fixed an issue decoding optional arrays of _ToleratedDecode enums.
  • New fields in DiscordApplication and PartialApplication: guild: PartialGuild?, approximate_guild_count: Int?.
  • New field in DiscordUser, PartialUser and MentionUser: avatar_decoration: String?.
  • New AuditLog.Entry.Action cases: creatorMonetizationRequestCreated and creatorMonetizationTermsAccepted.
  • Better decode tolerance in AuditLog.Entry.Action.
  • New DiscordChannel.Attachment.Flag type containing 1 case: isRemix.
  • New field in DiscordChannel.Attachment: flags: IntBitField<Flag>.
  • New JSONErrorCode cases: cannotEnableOnboardingRequirementsAreNotMet and cannotUpdateOnboardingWhileBelowRequirements.
  • New MessageReactionAdd field: message_author_id: UserSnowflake?.
  • New Guild.Onboarding.Mode type containing 2 cases: onboardingDefault and onboardingAdvanced.
  • New field in Guild.Onboarding: mode: Mode.
  • New field in Payloads.CreateGuildChannel: default_forum_layout: DiscordChannel.ForumLayout?.
  • New Role.Flag type containing 1 case: inPrompt.
  • New field in Role: flags: IntBitField<Flag>.

Full Changelog: v1.0.0...v1.1.0

v1.0.0 - First Release :)

02 Jul 08:25
Compare
Choose a tag to compare
0