From d10a918e69c83809a48d8d7aa97bf4ef4010ad9d Mon Sep 17 00:00:00 2001 From: lukellmann Date: Mon, 18 Sep 2023 18:40:26 +0200 Subject: [PATCH] Add with_counts param for GET /users/@me/guilds See https://github.com/discord/discord-api-docs/pull/5628 --- common/api/common.api | 16 ++++++++++------ .../src/commonMain/kotlin/entity/DiscordGuild.kt | 4 ++++ core/api/core.api | 10 +++++++--- .../kotlin/cache/data/PartialGuildData.kt | 10 +++++----- .../src/commonMain/kotlin/entity/PartialGuild.kt | 14 ++++++++++++++ rest/api/rest.api | 4 +++- .../src/commonMain/kotlin/service/UserService.kt | 8 ++++++++ 7 files changed, 51 insertions(+), 15 deletions(-) diff --git a/common/api/common.api b/common/api/common.api index 375dc3c25e5..c4ce5f918d3 100644 --- a/common/api/common.api +++ b/common/api/common.api @@ -5236,9 +5236,9 @@ public final class dev/kord/common/entity/DiscordPartialEmoji$Companion { public final class dev/kord/common/entity/DiscordPartialGuild { public static final field Companion Ldev/kord/common/entity/DiscordPartialGuild$Companion; - public synthetic fun (ILdev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;)V - public synthetic fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILdev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalBoolean;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalBoolean;)V + public synthetic fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalBoolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/Snowflake; public final fun component10 ()Ldev/kord/common/entity/optional/Optional; public final fun component11 ()Ldev/kord/common/entity/optional/Optional; @@ -5247,7 +5247,9 @@ public final class dev/kord/common/entity/DiscordPartialGuild { public final fun component14 ()Ldev/kord/common/entity/optional/Optional; public final fun component15 ()Ldev/kord/common/entity/optional/Optional; public final fun component16 ()Ldev/kord/common/entity/optional/Optional; - public final fun component17 ()Ldev/kord/common/entity/optional/OptionalBoolean; + public final fun component17 ()Ldev/kord/common/entity/optional/OptionalInt; + public final fun component18 ()Ldev/kord/common/entity/optional/OptionalInt; + public final fun component19 ()Ldev/kord/common/entity/optional/OptionalBoolean; public final fun component2 ()Ljava/lang/String; public final fun component3 ()Ljava/lang/String; public final fun component4 ()Ldev/kord/common/entity/optional/OptionalBoolean; @@ -5256,9 +5258,11 @@ public final class dev/kord/common/entity/DiscordPartialGuild { public final fun component7 ()Ldev/kord/common/entity/optional/Optional; public final fun component8 ()Ldev/kord/common/entity/optional/Optional; public final fun component9 ()Ldev/kord/common/entity/optional/Optional; - public final fun copy (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;)Ldev/kord/common/entity/DiscordPartialGuild; - public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordPartialGuild;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordPartialGuild; + public final fun copy (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalBoolean;)Ldev/kord/common/entity/DiscordPartialGuild; + public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordPartialGuild;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalBoolean;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordPartialGuild; public fun equals (Ljava/lang/Object;)Z + public final fun getApproximateMemberCount ()Ldev/kord/common/entity/optional/OptionalInt; + public final fun getApproximatePresenceCount ()Ldev/kord/common/entity/optional/OptionalInt; public final fun getBanner ()Ldev/kord/common/entity/optional/Optional; public final fun getDescription ()Ldev/kord/common/entity/optional/Optional; public final fun getFeatures ()Ljava/util/List; diff --git a/common/src/commonMain/kotlin/entity/DiscordGuild.kt b/common/src/commonMain/kotlin/entity/DiscordGuild.kt index b7302575128..ba01d318936 100644 --- a/common/src/commonMain/kotlin/entity/DiscordGuild.kt +++ b/common/src/commonMain/kotlin/entity/DiscordGuild.kt @@ -346,6 +346,10 @@ public data class DiscordPartialGuild( val stickers: Optional> = Optional.Missing(), @SerialName("guild_scheduled_events") val guildScheduledEvents: Optional> = Optional.Missing(), + @SerialName("approximate_member_count") + val approximateMemberCount: OptionalInt = OptionalInt.Missing, + @SerialName("approximate_presence_count") + val approximatePresenceCount: OptionalInt = OptionalInt.Missing, @SerialName("premium_progress_bar_enabled") val premiumProgressBarEnabled: OptionalBoolean = OptionalBoolean.Missing, ) diff --git a/core/api/core.api b/core/api/core.api index 060c4c669f1..4bf4a7517b7 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -4631,9 +4631,11 @@ public final class dev/kord/core/cache/data/PartialApplicationData$Companion { public final class dev/kord/core/cache/data/PartialGuildData { public static final field Companion Ldev/kord/core/cache/data/PartialGuildData$Companion; - public synthetic fun (ILdev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;)V - public synthetic fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILdev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalBoolean;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalBoolean;)V + public synthetic fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalBoolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun getApproximateMemberCount ()Ldev/kord/common/entity/optional/OptionalInt; + public final fun getApproximatePresenceCount ()Ldev/kord/common/entity/optional/OptionalInt; public final fun getBanner ()Ldev/kord/common/entity/optional/Optional; public final fun getDescription ()Ldev/kord/common/entity/optional/Optional; public final fun getFeatures ()Ljava/util/List; @@ -6844,6 +6846,8 @@ public final class dev/kord/core/entity/PartialGuild : dev/kord/core/behavior/Gu public fun getApplicationCommand (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getApplicationCommandOrNull (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getApplicationCommands (Ljava/lang/Boolean;)Lkotlinx/coroutines/flow/Flow; + public final fun getApproximateMemberCount ()Ljava/lang/Integer; + public final fun getApproximatePresenceCount ()Ljava/lang/Integer; public fun getAutoModerationRule (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getAutoModerationRuleOrNull (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getAutoModerationRules ()Lkotlinx/coroutines/flow/Flow; diff --git a/core/src/commonMain/kotlin/cache/data/PartialGuildData.kt b/core/src/commonMain/kotlin/cache/data/PartialGuildData.kt index 092edd8acf9..b973f2e1af7 100644 --- a/core/src/commonMain/kotlin/cache/data/PartialGuildData.kt +++ b/core/src/commonMain/kotlin/cache/data/PartialGuildData.kt @@ -1,10 +1,7 @@ package dev.kord.core.cache.data import dev.kord.common.entity.* -import dev.kord.common.entity.optional.Optional -import dev.kord.common.entity.optional.OptionalBoolean -import dev.kord.common.entity.optional.map -import dev.kord.common.entity.optional.mapList +import dev.kord.common.entity.optional.* import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -27,8 +24,9 @@ public class PartialGuildData( public val stageInstances: Optional> = Optional.Missing(), public val stickers: Optional> = Optional.Missing(), public val guildScheduledEvents: Optional> = Optional.Missing(), + public val approximateMemberCount: OptionalInt = OptionalInt.Missing, + public val approximatePresenceCount: OptionalInt = OptionalInt.Missing, public val premiumProgressBarEnabled: OptionalBoolean = OptionalBoolean.Missing - ) { public companion object { public fun from(partialGuild: DiscordPartialGuild): PartialGuildData = with(partialGuild) { @@ -49,6 +47,8 @@ public class PartialGuildData( stageInstances = stageInstances.mapList { StageInstanceData.from(it) }, stickers = stickers.mapList { StickerData.from(it) }, guildScheduledEvents = guildScheduledEvents.mapList { GuildScheduledEventData.from(it) }, + approximateMemberCount = approximateMemberCount, + approximatePresenceCount = approximatePresenceCount, premiumProgressBarEnabled = premiumProgressBarEnabled ) } diff --git a/core/src/commonMain/kotlin/entity/PartialGuild.kt b/core/src/commonMain/kotlin/entity/PartialGuild.kt index 5f82bf553d2..d228f031e84 100644 --- a/core/src/commonMain/kotlin/entity/PartialGuild.kt +++ b/core/src/commonMain/kotlin/entity/PartialGuild.kt @@ -94,6 +94,20 @@ public class PartialGuild( public val banner: Asset? get() = bannerHash?.let { Asset.guildBanner(id, it, kord) } + /** + * The approximate number of members in this guild. + * + * Present if this guild was requested through [rest][dev.kord.rest.service.RestClient] with the flag `with_counts`. + */ + public val approximateMemberCount: Int? get() = data.approximateMemberCount.value + + /** + * The approximate number of online members in this guild. + * + * Present if this guild was requested through [rest][dev.kord.rest.service.RestClient] with the flag `with_counts`. + */ + public val approximatePresenceCount: Int? get() = data.approximatePresenceCount.value + /** * Gets the discovery splash url in the specified [format], if present. */ diff --git a/rest/api/rest.api b/rest/api/rest.api index 67c93544879..c97a969bb8b 100644 --- a/rest/api/rest.api +++ b/rest/api/rest.api @@ -7719,7 +7719,9 @@ public final class dev/kord/rest/service/UserService : dev/kord/rest/service/Res public final fun createDM (Ldev/kord/rest/json/request/DMCreateRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun createGroupDM (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getCurrentUser (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getCurrentUserGuilds (Ldev/kord/rest/route/Position$BeforeOrAfter;Ljava/lang/Integer;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final fun getCurrentUserGuilds (Ldev/kord/rest/route/Position$BeforeOrAfter;Ljava/lang/Integer;Ljava/lang/Boolean;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final synthetic fun getCurrentUserGuilds (Ldev/kord/rest/route/Position$BeforeOrAfter;Ljava/lang/Integer;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun getCurrentUserGuilds$default (Ldev/kord/rest/service/UserService;Ldev/kord/rest/route/Position$BeforeOrAfter;Ljava/lang/Integer;Ljava/lang/Boolean;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun getCurrentUserGuilds$default (Ldev/kord/rest/service/UserService;Ldev/kord/rest/route/Position$BeforeOrAfter;Ljava/lang/Integer;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public final fun getUser (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getUserConnections (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; diff --git a/rest/src/commonMain/kotlin/service/UserService.kt b/rest/src/commonMain/kotlin/service/UserService.kt index 6b169d380d3..a081dd993bd 100644 --- a/rest/src/commonMain/kotlin/service/UserService.kt +++ b/rest/src/commonMain/kotlin/service/UserService.kt @@ -24,12 +24,20 @@ public class UserService(requestHandler: RequestHandler) : RestService(requestHa keys[Route.UserId] = userId } + @Deprecated("Binary compatibility, keep for some releases.", level = DeprecationLevel.HIDDEN) public suspend fun getCurrentUserGuilds( position: Position.BeforeOrAfter? = null, limit: Int? = null, + ): List = getCurrentUserGuilds(position, limit, withCounts = null) + + public suspend fun getCurrentUserGuilds( + position: Position.BeforeOrAfter? = null, + limit: Int? = null, + withCounts: Boolean? = null, ): List = call(Route.CurrentUsersGuildsGet) { position?.let { parameter(it.key, it.value) } limit?.let { parameter("limit", it) } + withCounts?.let { parameter("with_counts", it) } } public suspend fun leaveGuild(guildId: Snowflake): Unit = call(Route.GuildLeave) {