From 329592d7f0260ef45daa8f4555f1592e11ef1062 Mon Sep 17 00:00:00 2001 From: Luis <40919071+dookon@users.noreply.github.com> Date: Tue, 15 Nov 2022 22:18:04 -0300 Subject: [PATCH] Add missing properties for channel builders (#712) * Add missing properties for create forum channel * api dump * add missing fields in the other builders * api dump * move flags to forum threads * apply suggestions * Small fixes Co-authored-by: Lukellmann --- rest/api/rest.api | 70 ++++++++++++++++--- .../channel/EditGuildChannelBuilder.kt | 34 +++++++++ .../channel/ForumChannelCreateBuilder.kt | 29 ++++++++ .../channel/TextChannelCreateBuilder.kt | 4 ++ .../channel/thread/ThreadModifyBuilder.kt | 7 +- .../kotlin/json/request/ChannelRequests.kt | 9 +++ .../main/kotlin/json/request/GuildRequests.kt | 9 +++ 7 files changed, 151 insertions(+), 11 deletions(-) diff --git a/rest/api/rest.api b/rest/api/rest.api index db2aa70a7b31..8857b6504221 100644 --- a/rest/api/rest.api +++ b/rest/api/rest.api @@ -391,7 +391,13 @@ public final class dev/kord/rest/builder/channel/ChannelPermissionModifyBuilder public final class dev/kord/rest/builder/channel/ForumChannelCreateBuilder : dev/kord/rest/builder/AuditRequestBuilder, dev/kord/rest/builder/channel/PermissionOverwritesCreateBuilder { public fun (Ljava/lang/String;)V public fun addOverwrite (Ldev/kord/common/entity/Overwrite;)V + public final fun getAvailableTags ()Ljava/util/List; public final fun getDefaultAutoArchiveDuration ()Ldev/kord/common/entity/ArchiveDuration; + public final fun getDefaultReactionEmoji ()Ldev/kord/common/entity/DiscordDefaultReaction; + public final fun getDefaultReactionEmojiId ()Ldev/kord/common/entity/Snowflake; + public final fun getDefaultReactionEmojiName ()Ljava/lang/String; + public final fun getDefaultSortOrder ()Ldev/kord/common/entity/SortOrderType; + public final fun getDefaultThreadRateLimitPerUser-FghU774 ()Lkotlin/time/Duration; public final fun getName ()Ljava/lang/String; public final fun getNsfw ()Ljava/lang/Boolean; public final fun getParentId ()Ldev/kord/common/entity/Snowflake; @@ -400,7 +406,13 @@ public final class dev/kord/rest/builder/channel/ForumChannelCreateBuilder : dev public final fun getRateLimitPerUser-FghU774 ()Lkotlin/time/Duration; public fun getReason ()Ljava/lang/String; public final fun getTopic ()Ljava/lang/String; + public final fun setAvailableTags (Ljava/util/List;)V public final fun setDefaultAutoArchiveDuration (Ldev/kord/common/entity/ArchiveDuration;)V + public final fun setDefaultReactionEmoji (Ldev/kord/common/entity/DiscordDefaultReaction;)V + public final fun setDefaultReactionEmojiId (Ldev/kord/common/entity/Snowflake;)V + public final fun setDefaultReactionEmojiName (Ljava/lang/String;)V + public final fun setDefaultSortOrder (Ldev/kord/common/entity/SortOrderType;)V + public final fun setDefaultThreadRateLimitPerUser-BwNAW2A (Lkotlin/time/Duration;)V public final fun setName (Ljava/lang/String;)V public final fun setNsfw (Ljava/lang/Boolean;)V public final fun setParentId (Ldev/kord/common/entity/Snowflake;)V @@ -416,7 +428,14 @@ public final class dev/kord/rest/builder/channel/ForumChannelCreateBuilder : dev public final class dev/kord/rest/builder/channel/ForumChannelModifyBuilder : dev/kord/rest/builder/AuditRequestBuilder, dev/kord/rest/builder/channel/PermissionOverwritesModifyBuilder { public fun ()V public fun addOverwrite (Ldev/kord/common/entity/Overwrite;)V + public final fun getAvailableTags ()Ljava/util/List; public final fun getDefaultAutoArchiveDuration ()Ldev/kord/common/entity/ArchiveDuration; + public final fun getDefaultReactionEmoji ()Ldev/kord/common/entity/DiscordDefaultReaction; + public final fun getDefaultReactionEmojiId ()Ldev/kord/common/entity/Snowflake; + public final fun getDefaultReactionEmojiName ()Ljava/lang/String; + public final fun getDefaultSortOrder ()Ldev/kord/common/entity/SortOrderType; + public final fun getDefaultThreadRateLimitPerUser-FghU774 ()Lkotlin/time/Duration; + public final fun getFlags ()Ldev/kord/common/entity/ChannelFlags; public final fun getName ()Ljava/lang/String; public final fun getNsfw ()Ljava/lang/Boolean; public final fun getParentId ()Ldev/kord/common/entity/Snowflake; @@ -425,7 +444,14 @@ public final class dev/kord/rest/builder/channel/ForumChannelModifyBuilder : dev public final fun getRateLimitPerUser-FghU774 ()Lkotlin/time/Duration; public fun getReason ()Ljava/lang/String; public final fun getTopic ()Ljava/lang/String; + public final fun setAvailableTags (Ljava/util/List;)V public final fun setDefaultAutoArchiveDuration (Ldev/kord/common/entity/ArchiveDuration;)V + public final fun setDefaultReactionEmoji (Ldev/kord/common/entity/DiscordDefaultReaction;)V + public final fun setDefaultReactionEmojiId (Ldev/kord/common/entity/Snowflake;)V + public final fun setDefaultReactionEmojiName (Ljava/lang/String;)V + public final fun setDefaultSortOrder (Ldev/kord/common/entity/SortOrderType;)V + public final fun setDefaultThreadRateLimitPerUser-BwNAW2A (Lkotlin/time/Duration;)V + public final fun setFlags (Ldev/kord/common/entity/ChannelFlags;)V public final fun setName (Ljava/lang/String;)V public final fun setNsfw (Ljava/lang/Boolean;)V public final fun setParentId (Ldev/kord/common/entity/Snowflake;)V @@ -618,6 +644,7 @@ public final class dev/kord/rest/builder/channel/TextChannelCreateBuilder : dev/ public fun (Ljava/lang/String;)V public fun addOverwrite (Ldev/kord/common/entity/Overwrite;)V public final fun getDefaultAutoArchiveDuration ()Ldev/kord/common/entity/ArchiveDuration; + public final fun getDefaultThreadRateLimitPerUser-FghU774 ()Lkotlin/time/Duration; public final fun getName ()Ljava/lang/String; public final fun getNsfw ()Ljava/lang/Boolean; public final fun getParentId ()Ldev/kord/common/entity/Snowflake; @@ -627,6 +654,7 @@ public final class dev/kord/rest/builder/channel/TextChannelCreateBuilder : dev/ public fun getReason ()Ljava/lang/String; public final fun getTopic ()Ljava/lang/String; public final fun setDefaultAutoArchiveDuration (Ldev/kord/common/entity/ArchiveDuration;)V + public final fun setDefaultThreadRateLimitPerUser-BwNAW2A (Lkotlin/time/Duration;)V public final fun setName (Ljava/lang/String;)V public final fun setNsfw (Ljava/lang/Boolean;)V public final fun setParentId (Ldev/kord/common/entity/Snowflake;)V @@ -747,6 +775,7 @@ public final class dev/kord/rest/builder/channel/thread/ThreadModifyBuilder : de public fun ()V public final fun getArchived ()Ljava/lang/Boolean; public final fun getAutoArchiveDuration ()Ldev/kord/common/entity/ArchiveDuration; + public final fun getFlags ()Ldev/kord/common/entity/ChannelFlags; public final fun getInvitable ()Ljava/lang/Boolean; public final fun getLocked ()Ljava/lang/Boolean; public final fun getName ()Ljava/lang/String; @@ -754,6 +783,7 @@ public final class dev/kord/rest/builder/channel/thread/ThreadModifyBuilder : de public fun getReason ()Ljava/lang/String; public final fun setArchived (Ljava/lang/Boolean;)V public final fun setAutoArchiveDuration (Ldev/kord/common/entity/ArchiveDuration;)V + public final fun setFlags (Ldev/kord/common/entity/ChannelFlags;)V public final fun setInvitable (Ljava/lang/Boolean;)V public final fun setLocked (Ljava/lang/Boolean;)V public final fun setName (Ljava/lang/String;)V @@ -2685,9 +2715,9 @@ public final class dev/kord/rest/json/request/ChannelFollowRequest$Companion { public final class dev/kord/rest/json/request/ChannelModifyPatchRequest { public static final field Companion Ldev/kord/rest/json/request/ChannelModifyPatchRequest$Companion; public fun ()V - public synthetic fun (ILdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V - public synthetic fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;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;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;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;)V + public synthetic fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;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;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/optional/Optional; public final fun component10 ()Ldev/kord/common/entity/optional/OptionalBoolean; public final fun component11 ()Ldev/kord/common/entity/optional/Optional; @@ -2696,7 +2726,12 @@ public final class dev/kord/rest/json/request/ChannelModifyPatchRequest { public final fun component14 ()Ldev/kord/common/entity/optional/OptionalBoolean; 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/Optional; + public final fun component18 ()Ldev/kord/common/entity/optional/Optional; + public final fun component19 ()Ldev/kord/common/entity/optional/Optional; public final fun component2 ()Ldev/kord/common/entity/optional/OptionalInt; + public final fun component20 ()Ldev/kord/common/entity/optional/Optional; + public final fun component21 ()Ldev/kord/common/entity/optional/Optional; public final fun component3 ()Ldev/kord/common/entity/optional/Optional; public final fun component4 ()Ldev/kord/common/entity/optional/OptionalBoolean; public final fun component5 ()Ldev/kord/common/entity/optional/Optional; @@ -2704,13 +2739,18 @@ public final class dev/kord/rest/json/request/ChannelModifyPatchRequest { public final fun component7 ()Ldev/kord/common/entity/optional/OptionalInt; public final fun component8 ()Ldev/kord/common/entity/optional/Optional; public final fun component9 ()Ldev/kord/common/entity/optional/OptionalSnowflake; - public final fun copy (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/rest/json/request/ChannelModifyPatchRequest; - public static synthetic fun copy$default (Ldev/kord/rest/json/request/ChannelModifyPatchRequest;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/rest/json/request/ChannelModifyPatchRequest; + public final fun copy (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;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/rest/json/request/ChannelModifyPatchRequest; + public static synthetic fun copy$default (Ldev/kord/rest/json/request/ChannelModifyPatchRequest;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;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;ILjava/lang/Object;)Ldev/kord/rest/json/request/ChannelModifyPatchRequest; public fun equals (Ljava/lang/Object;)Z public final fun getArchived ()Ldev/kord/common/entity/optional/OptionalBoolean; public final fun getAutoArchiveDuration ()Ldev/kord/common/entity/optional/Optional; + public final fun getAvailableTags ()Ldev/kord/common/entity/optional/Optional; public final fun getBitrate ()Ldev/kord/common/entity/optional/OptionalInt; public final fun getDefaultAutoArchiveDuration ()Ldev/kord/common/entity/optional/Optional; + public final fun getDefaultReactionEmoji ()Ldev/kord/common/entity/optional/Optional; + public final fun getDefaultSortOrder ()Ldev/kord/common/entity/optional/Optional; + public final fun getDefaultThreadRateLimitPerUser ()Ldev/kord/common/entity/optional/Optional; + public final fun getFlags ()Ldev/kord/common/entity/optional/Optional; public final fun getInvitable ()Ldev/kord/common/entity/optional/OptionalBoolean; public final fun getLocked ()Ldev/kord/common/entity/optional/OptionalBoolean; public final fun getName ()Ldev/kord/common/entity/optional/Optional; @@ -3436,13 +3476,18 @@ public final class dev/kord/rest/json/request/GuildBanCreateRequest$Companion { public final class dev/kord/rest/json/request/GuildChannelCreateRequest { public static final field Companion Ldev/kord/rest/json/request/GuildChannelCreateRequest$Companion; - public synthetic fun (ILjava/lang/String;Ldev/kord/common/entity/ChannelType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Ljava/lang/String;Ldev/kord/common/entity/ChannelType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;)V - public synthetic fun (Ljava/lang/String;Ldev/kord/common/entity/ChannelType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILjava/lang/String;Ldev/kord/common/entity/ChannelType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/OptionalSnowflake;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;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ljava/lang/String;Ldev/kord/common/entity/ChannelType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/OptionalSnowflake;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;)V + public synthetic fun (Ljava/lang/String;Ldev/kord/common/entity/ChannelType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/OptionalSnowflake;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;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ljava/lang/String; public final fun component10 ()Ldev/kord/common/entity/optional/OptionalBoolean; public final fun component11 ()Ldev/kord/common/entity/optional/OptionalSnowflake; public final fun component12 ()Ldev/kord/common/entity/optional/Optional; + public final fun component13 ()Ldev/kord/common/entity/optional/Optional; + 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/Optional; public final fun component2 ()Ldev/kord/common/entity/ChannelType; public final fun component3 ()Ldev/kord/common/entity/optional/Optional; public final fun component4 ()Ldev/kord/common/entity/optional/OptionalInt; @@ -3451,11 +3496,16 @@ public final class dev/kord/rest/json/request/GuildChannelCreateRequest { public final fun component7 ()Ldev/kord/common/entity/optional/OptionalInt; public final fun component8 ()Ldev/kord/common/entity/optional/Optional; public final fun component9 ()Ldev/kord/common/entity/optional/OptionalSnowflake; - public final fun copy (Ljava/lang/String;Ldev/kord/common/entity/ChannelType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/rest/json/request/GuildChannelCreateRequest; - public static synthetic fun copy$default (Ldev/kord/rest/json/request/GuildChannelCreateRequest;Ljava/lang/String;Ldev/kord/common/entity/ChannelType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/rest/json/request/GuildChannelCreateRequest; + public final fun copy (Ljava/lang/String;Ldev/kord/common/entity/ChannelType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/OptionalSnowflake;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/rest/json/request/GuildChannelCreateRequest; + public static synthetic fun copy$default (Ldev/kord/rest/json/request/GuildChannelCreateRequest;Ljava/lang/String;Ldev/kord/common/entity/ChannelType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/OptionalSnowflake;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;ILjava/lang/Object;)Ldev/kord/rest/json/request/GuildChannelCreateRequest; public fun equals (Ljava/lang/Object;)Z + public final fun getAvailableTags ()Ldev/kord/common/entity/optional/Optional; public final fun getBitrate ()Ldev/kord/common/entity/optional/OptionalInt; public final fun getDefaultAutoArchiveDuration ()Ldev/kord/common/entity/optional/Optional; + public final fun getDefaultReactionEmoji ()Ldev/kord/common/entity/optional/Optional; + public final fun getDefaultSortOrder ()Ldev/kord/common/entity/optional/Optional; + public final fun getDefaultThreadRateLimitPerUser ()Ldev/kord/common/entity/optional/Optional; + public final fun getFlags ()Ldev/kord/common/entity/optional/Optional; public final fun getId ()Ldev/kord/common/entity/optional/OptionalSnowflake; public final fun getName ()Ljava/lang/String; public final fun getNsfw ()Ldev/kord/common/entity/optional/OptionalBoolean; diff --git a/rest/src/main/kotlin/builder/channel/EditGuildChannelBuilder.kt b/rest/src/main/kotlin/builder/channel/EditGuildChannelBuilder.kt index 9fa41efad3f7..d44e2efcbf7b 100644 --- a/rest/src/main/kotlin/builder/channel/EditGuildChannelBuilder.kt +++ b/rest/src/main/kotlin/builder/channel/EditGuildChannelBuilder.kt @@ -2,14 +2,19 @@ package dev.kord.rest.builder.channel import dev.kord.common.annotation.KordDsl import dev.kord.common.entity.ArchiveDuration +import dev.kord.common.entity.ChannelFlags +import dev.kord.common.entity.DiscordDefaultReaction +import dev.kord.common.entity.DiscordForumTag import dev.kord.common.entity.Overwrite import dev.kord.common.entity.Snowflake +import dev.kord.common.entity.SortOrderType import dev.kord.common.entity.VideoQualityMode import dev.kord.common.entity.optional.Optional import dev.kord.common.entity.optional.OptionalBoolean import dev.kord.common.entity.optional.OptionalInt import dev.kord.common.entity.optional.OptionalSnowflake import dev.kord.common.entity.optional.delegate.delegate +import dev.kord.common.entity.optional.optional import dev.kord.rest.builder.AuditRequestBuilder import dev.kord.rest.json.request.ChannelModifyPatchRequest import kotlin.DeprecationLevel.HIDDEN @@ -96,6 +101,23 @@ public class ForumChannelModifyBuilder : PermissionOverwritesModifyBuilder, */ public var defaultAutoArchiveDuration: ArchiveDuration? by ::_defaultAutoArchiveDuration.delegate() + private var _flags: Optional = Optional.Missing() + public var flags: ChannelFlags? by ::_flags.delegate() + + private var _defaultReactionEmoji: Optional = Optional.Missing() + public var defaultReactionEmoji: DiscordDefaultReaction? by ::_defaultReactionEmoji.delegate() + public var defaultReactionEmojiId: Snowflake? = null + public var defaultReactionEmojiName: String? = null + + private var _availableTags: Optional> = Optional.Missing() + public var availableTags: List? by ::_availableTags.delegate() + + private var _defaultThreadRateLimitPerUser: Optional = Optional.Missing() + public var defaultThreadRateLimitPerUser: Duration? by ::_defaultThreadRateLimitPerUser.delegate() + + private var _defaultSortOrder: Optional = Optional.Missing() + public var defaultSortOrder: SortOrderType? by ::_defaultSortOrder.delegate() + override fun toRequest(): ChannelModifyPatchRequest = ChannelModifyPatchRequest( name = _name, position = _position, @@ -105,6 +127,18 @@ public class ForumChannelModifyBuilder : PermissionOverwritesModifyBuilder, permissionOverwrites = _permissionOverwrites, parentId = _parentId, defaultAutoArchiveDuration = _defaultAutoArchiveDuration, + defaultReactionEmoji = when { + defaultReactionEmojiId != null || defaultReactionEmojiName != null -> + DiscordDefaultReaction( + emojiId = defaultReactionEmojiId, + emojiName = defaultReactionEmojiName, + ).optional() + else -> _defaultReactionEmoji + }, + defaultThreadRateLimitPerUser = _defaultThreadRateLimitPerUser, + availableTags = _availableTags, + defaultSortOrder = _defaultSortOrder, + flags = _flags ) } diff --git a/rest/src/main/kotlin/builder/channel/ForumChannelCreateBuilder.kt b/rest/src/main/kotlin/builder/channel/ForumChannelCreateBuilder.kt index dced1daaa2fc..70b6e06400c3 100644 --- a/rest/src/main/kotlin/builder/channel/ForumChannelCreateBuilder.kt +++ b/rest/src/main/kotlin/builder/channel/ForumChannelCreateBuilder.kt @@ -3,13 +3,17 @@ package dev.kord.rest.builder.channel import dev.kord.common.annotation.KordDsl import dev.kord.common.entity.ArchiveDuration import dev.kord.common.entity.ChannelType +import dev.kord.common.entity.DiscordDefaultReaction +import dev.kord.common.entity.DiscordForumTag import dev.kord.common.entity.Overwrite import dev.kord.common.entity.Snowflake +import dev.kord.common.entity.SortOrderType import dev.kord.common.entity.optional.Optional import dev.kord.common.entity.optional.OptionalBoolean import dev.kord.common.entity.optional.OptionalInt import dev.kord.common.entity.optional.OptionalSnowflake import dev.kord.common.entity.optional.delegate.delegate +import dev.kord.common.entity.optional.optional import dev.kord.rest.builder.AuditRequestBuilder import dev.kord.rest.json.request.GuildChannelCreateRequest import kotlin.time.Duration @@ -45,6 +49,20 @@ public class ForumChannelCreateBuilder(public var name: String) : override var permissionOverwrites: MutableSet = mutableSetOf() + private var _defaultReactionEmoji: Optional = Optional.Missing() + public var defaultReactionEmoji: DiscordDefaultReaction? by ::_defaultReactionEmoji.delegate() + public var defaultReactionEmojiId: Snowflake? = null + public var defaultReactionEmojiName: String? = null + + private var _availableTags: Optional?> = Optional.Missing() + public var availableTags: List? by ::_availableTags.delegate() + + private var _defaultThreadRateLimitPerUser: Optional = Optional.Missing() + public var defaultThreadRateLimitPerUser: Duration? by ::_defaultThreadRateLimitPerUser.delegate() + + private var _defaultSortOrder: Optional = Optional.Missing() + public var defaultSortOrder: SortOrderType? by ::_defaultSortOrder.delegate() + override fun toRequest(): GuildChannelCreateRequest = GuildChannelCreateRequest( name = name, type = ChannelType.GuildForum, @@ -55,5 +73,16 @@ public class ForumChannelCreateBuilder(public var name: String) : nsfw = _nsfw, permissionOverwrite = Optional.missingOnEmpty(permissionOverwrites), defaultAutoArchiveDuration = _defaultAutoArchiveDuration, + defaultReactionEmoji = when { + defaultReactionEmojiId != null || defaultReactionEmojiName != null -> + DiscordDefaultReaction( + emojiId = defaultReactionEmojiId, + emojiName = defaultReactionEmojiName, + ).optional() + else -> _defaultReactionEmoji + }, + defaultThreadRateLimitPerUser = _defaultThreadRateLimitPerUser, + availableTags = _availableTags, + defaultSortOrder = _defaultSortOrder, ) } diff --git a/rest/src/main/kotlin/builder/channel/TextChannelCreateBuilder.kt b/rest/src/main/kotlin/builder/channel/TextChannelCreateBuilder.kt index 65239256fb7b..c42cb1439d3a 100644 --- a/rest/src/main/kotlin/builder/channel/TextChannelCreateBuilder.kt +++ b/rest/src/main/kotlin/builder/channel/TextChannelCreateBuilder.kt @@ -45,6 +45,9 @@ public class TextChannelCreateBuilder(public var name: String) : override var permissionOverwrites: MutableSet = mutableSetOf() + private var _defaultThreadRateLimitPerUser: Optional = Optional.Missing() + public var defaultThreadRateLimitPerUser: Duration? by ::_defaultThreadRateLimitPerUser.delegate() + override fun toRequest(): GuildChannelCreateRequest = GuildChannelCreateRequest( name = name, type = ChannelType.GuildText, @@ -55,5 +58,6 @@ public class TextChannelCreateBuilder(public var name: String) : nsfw = _nsfw, permissionOverwrite = Optional.missingOnEmpty(permissionOverwrites), defaultAutoArchiveDuration = _defaultAutoArchiveDuration, + defaultThreadRateLimitPerUser = _defaultThreadRateLimitPerUser ) } diff --git a/rest/src/main/kotlin/builder/channel/thread/ThreadModifyBuilder.kt b/rest/src/main/kotlin/builder/channel/thread/ThreadModifyBuilder.kt index c4a25fa4888d..b4e6e3c2c63a 100644 --- a/rest/src/main/kotlin/builder/channel/thread/ThreadModifyBuilder.kt +++ b/rest/src/main/kotlin/builder/channel/thread/ThreadModifyBuilder.kt @@ -1,6 +1,7 @@ package dev.kord.rest.builder.channel.thread import dev.kord.common.entity.ArchiveDuration +import dev.kord.common.entity.ChannelFlags import dev.kord.common.entity.optional.Optional import dev.kord.common.entity.optional.OptionalBoolean import dev.kord.common.entity.optional.delegate.delegate @@ -28,6 +29,9 @@ public class ThreadModifyBuilder : AuditRequestBuilder = Optional.Missing() + public var flags: ChannelFlags? by ::_flags.delegate() + override fun toRequest(): ChannelModifyPatchRequest { return ChannelModifyPatchRequest( name = _name, @@ -35,7 +39,8 @@ public class ThreadModifyBuilder : AuditRequestBuilder = Optional.Missing(), @SerialName("default_auto_archive_duration") val defaultAutoArchiveDuration: Optional = Optional.Missing(), + @SerialName("default_reaction_emoji") + val defaultReactionEmoji: Optional = Optional.Missing(), + @SerialName("default_thread_rate_limit_per_user") + val defaultThreadRateLimitPerUser: Optional = Optional.Missing(), + val flags: Optional = Optional.Missing(), + @SerialName("available_tags") + val availableTags: Optional> = Optional.Missing(), + @SerialName("default_sort_order") + val defaultSortOrder: Optional = Optional.Missing(), ) @Serializable diff --git a/rest/src/main/kotlin/json/request/GuildRequests.kt b/rest/src/main/kotlin/json/request/GuildRequests.kt index aed6116abb53..a21fcf1a4889 100644 --- a/rest/src/main/kotlin/json/request/GuildRequests.kt +++ b/rest/src/main/kotlin/json/request/GuildRequests.kt @@ -59,6 +59,15 @@ public data class GuildChannelCreateRequest( val id: OptionalSnowflake = OptionalSnowflake.Missing, @SerialName("default_auto_archive_duration") val defaultAutoArchiveDuration: Optional = Optional.Missing(), + @SerialName("default_reaction_emoji") + val defaultReactionEmoji: Optional = Optional.Missing(), + @SerialName("default_thread_rate_limit_per_user") + val defaultThreadRateLimitPerUser: Optional = Optional.Missing(), + val flags: Optional = Optional.Missing(), + @SerialName("available_tags") + val availableTags: Optional?> = Optional.Missing(), + @SerialName("default_sort_order") + val defaultSortOrder: Optional = Optional.Missing(), ) @Serializable