Skip to content

Commit

Permalink
chore: update links
Browse files Browse the repository at this point in the history
The documentation was restructured recently [1].

[1] discord/discord-api-docs#7109
  • Loading branch information
lukellmann committed Sep 8, 2024
1 parent 8dd41c3 commit 54827ee
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import kotlinx.serialization.encoding.Encoder

/**
* See [EntitlementOwnerType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement).
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/entitlement#create-test-entitlement-json-params).
*/
@Serializable(with = EntitlementOwnerType.Serializer::class)
public sealed class EntitlementOwnerType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import kotlinx.serialization.encoding.Encoder

/**
* See [EntitlementType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types).
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-types).
*/
@Serializable(with = EntitlementType.Serializer::class)
public sealed class EntitlementType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import kotlinx.serialization.encoding.Encoder

/**
* See [SkuFlag]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/monetization/skus#sku-object-sku-flags).
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/sku#sku-object-sku-flags).
*/
public sealed class SkuFlag(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import kotlinx.serialization.encoding.Encoder

/**
* See [SkuType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/monetization/skus#sku-object-sku-types).
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/sku#sku-object-sku-types).
*/
@Serializable(with = SkuType.Serializer::class)
public sealed class SkuType(
Expand Down
8 changes: 4 additions & 4 deletions common/src/commonMain/kotlin/entity/Entitlements.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Generate(
INT_KORD_ENUM, name = "EntitlementType",
docUrl = "https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types",
docUrl = "https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-types",
entries = [
Entry("Purchase", intValue = 1, kDoc = "Entitlement that was purchased by a user."),
Entry("PremiumSubscription", intValue = 2, kDoc = "Entitlement for a Discord Nitro subscription."),
Expand All @@ -15,7 +15,7 @@

@file:Generate(
INT_KORD_ENUM, name = "EntitlementOwnerType",
docUrl = "https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement",
docUrl = "https://discord.com/developers/docs/resources/entitlement#create-test-entitlement-json-params",
entries = [
Entry("Guild", intValue = 1, kDoc = "Entitlement is owned by a guild."),
Entry("User", intValue = 2, kDoc = "Entitlement is owned by a user."),
Expand All @@ -35,7 +35,7 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* An instance of a [Discord Entitlement](https://discord.com/developers/docs/monetization/entitlements#entitlement-object)
* An instance of a [Discord Entitlement](https://discord.com/developers/docs/resources/entitlement#entitlement-object)
*/
@Serializable
public data class DiscordEntitlement(
Expand All @@ -55,4 +55,4 @@ public data class DiscordEntitlement(
@SerialName("guild_id")
val guildId: OptionalSnowflake = OptionalSnowflake.Missing,
val consumed: OptionalBoolean = OptionalBoolean.Missing,
)
)
6 changes: 3 additions & 3 deletions common/src/commonMain/kotlin/entity/Skus.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Generate(
INT_KORD_ENUM, name = "SkuType",
docUrl = "https://discord.com/developers/docs/monetization/skus#sku-object-sku-types",
docUrl = "https://discord.com/developers/docs/resources/sku#sku-object-sku-types",
entries = [
Entry("Durable", intValue = 2, kDoc = "A durable, one-time purchase."),
Entry("Consumable", intValue = 3, kDoc = "A consumable, one-time purchase."),
Expand All @@ -11,7 +11,7 @@

@file:Generate(
INT_FLAGS, name = "SkuFlag",
docUrl = "https://discord.com/developers/docs/monetization/skus#sku-object-sku-flags",
docUrl = "https://discord.com/developers/docs/resources/sku#sku-object-sku-flags",
entries = [
Entry("Available", shift = 2, kDoc = "SKU is available for purchase."),
Entry(
Expand All @@ -35,7 +35,7 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* Represents a [Discord SKU](https://discord.com/developers/docs/monetization/skus#sku-object).
* Represents a [Discord SKU](https://discord.com/developers/docs/resources/sku#sku-object).
*/
@Serializable
public data class DiscordSku(
Expand Down
4 changes: 2 additions & 2 deletions core/src/commonMain/kotlin/entity/Entitlement.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import dev.kord.rest.request.RestRequestException
import kotlinx.datetime.Instant

/**
* An instance of a [Discord Entitlement](https://discord.com/developers/docs/monetization/entitlements#entitlement-resource).
* An instance of a [Discord Entitlement](https://discord.com/developers/docs/resources/entitlement).
*
* Entitlements represent that a [User] or [Guild] has access to a premium offering in your [Application].
*/
Expand Down Expand Up @@ -96,7 +96,7 @@ public class Entitlement(
* Whether this entitlement is a test entitlement.
*/
public val isTest: Boolean
// see https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-structure
// see https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-structure
get() = endsAt == null && startsAt == null

/**
Expand Down
4 changes: 2 additions & 2 deletions core/src/commonMain/kotlin/entity/Sku.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import dev.kord.core.Kord
import dev.kord.core.hash

/**
* An instance of a [Discord Sku](https://discord.com/developers/docs/monetization/skus).
* An instance of a [Discord Sku](https://discord.com/developers/docs/resources/sku).
*
* SKUs (or stock-keeping units) represent premium offerings that can be made available to your [Application]'s [User]s or
* [Guild]s.
Expand Down Expand Up @@ -55,4 +55,4 @@ public class Sku(
override fun toString(): String {
return "Sku(data=$data, kord=$kord)"
}
}
}
2 changes: 1 addition & 1 deletion core/src/commonMain/kotlin/supplier/RestEntitySupplier.kt
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ public class RestEntitySupplier(public val kord: Kord) : EntitySupplier {
Entitlement(data, kord)
}

// maxBatchSize: see https://discord.com/developers/docs/monetization/entitlements#list-entitlements
// maxBatchSize: see https://discord.com/developers/docs/resources/entitlement#list-entitlements
override fun getEntitlements(
applicationId: Snowflake,
request: EntitlementsListRequest
Expand Down
8 changes: 4 additions & 4 deletions rest/src/commonMain/kotlin/route/Route.kt
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,8 @@ public sealed class Route<T>(


/*
* Entitlements:
* https://discord.com/developers/docs/monetization/entitlements
* Entitlement:
* https://discord.com/developers/docs/resources/entitlement
*/

public object EntitlementConsume :
Expand Down Expand Up @@ -781,8 +781,8 @@ public sealed class Route<T>(


/*
* SKUs:
* https://discord.com/developers/docs/monetization/skus
* SKU:
* https://discord.com/developers/docs/resources/sku
*/

public object SkusList :
Expand Down

0 comments on commit 54827ee

Please sign in to comment.