Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for application emojis #973

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions common/api/common.api
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,67 @@ public final class dev/kord/common/entity/ApplicationCommandType$User : dev/kord
public static final field INSTANCE Ldev/kord/common/entity/ApplicationCommandType$User;
}

public final class dev/kord/common/entity/ApplicationEmojis : java/util/List, kotlin/jvm/internal/markers/KMappedMarker {
public static final field Companion Ldev/kord/common/entity/ApplicationEmojis$Companion;
public fun <init> (Ljava/util/List;)V
public fun add (ILdev/kord/common/entity/DiscordEmoji;)V
public synthetic fun add (ILjava/lang/Object;)V
public fun add (Ldev/kord/common/entity/DiscordEmoji;)Z
public synthetic fun add (Ljava/lang/Object;)Z
public fun addAll (ILjava/util/Collection;)Z
public fun addAll (Ljava/util/Collection;)Z
public fun clear ()V
public final fun component1 ()Ljava/util/List;
public fun contains (Ldev/kord/common/entity/DiscordEmoji;)Z
public final fun contains (Ljava/lang/Object;)Z
public fun containsAll (Ljava/util/Collection;)Z
public final fun copy (Ljava/util/List;)Ldev/kord/common/entity/ApplicationEmojis;
public static synthetic fun copy$default (Ldev/kord/common/entity/ApplicationEmojis;Ljava/util/List;ILjava/lang/Object;)Ldev/kord/common/entity/ApplicationEmojis;
public fun equals (Ljava/lang/Object;)Z
public fun get (I)Ldev/kord/common/entity/DiscordEmoji;
public synthetic fun get (I)Ljava/lang/Object;
public final fun getItems ()Ljava/util/List;
public fun getSize ()I
public fun hashCode ()I
public fun indexOf (Ldev/kord/common/entity/DiscordEmoji;)I
public final fun indexOf (Ljava/lang/Object;)I
public fun isEmpty ()Z
public fun iterator ()Ljava/util/Iterator;
public fun lastIndexOf (Ldev/kord/common/entity/DiscordEmoji;)I
public final fun lastIndexOf (Ljava/lang/Object;)I
public fun listIterator ()Ljava/util/ListIterator;
public fun listIterator (I)Ljava/util/ListIterator;
public fun remove (I)Ldev/kord/common/entity/DiscordEmoji;
public synthetic fun remove (I)Ljava/lang/Object;
public fun remove (Ljava/lang/Object;)Z
public fun removeAll (Ljava/util/Collection;)Z
public fun replaceAll (Ljava/util/function/UnaryOperator;)V
public fun retainAll (Ljava/util/Collection;)Z
public fun set (ILdev/kord/common/entity/DiscordEmoji;)Ldev/kord/common/entity/DiscordEmoji;
public synthetic fun set (ILjava/lang/Object;)Ljava/lang/Object;
public final fun size ()I
public fun sort (Ljava/util/Comparator;)V
public fun subList (II)Ljava/util/List;
public fun toArray ()[Ljava/lang/Object;
public fun toArray ([Ljava/lang/Object;)[Ljava/lang/Object;
public fun toString ()Ljava/lang/String;
}

public synthetic class dev/kord/common/entity/ApplicationEmojis$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Ldev/kord/common/entity/ApplicationEmojis$$serializer;
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/ApplicationEmojis;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/ApplicationEmojis;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}

public final class dev/kord/common/entity/ApplicationEmojis$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public abstract class dev/kord/common/entity/ApplicationFlag {
public static final field Companion Ldev/kord/common/entity/ApplicationFlag$Companion;
public synthetic fun <init> (ILkotlin/jvm/internal/DefaultConstructorMarker;)V
Expand Down
41 changes: 41 additions & 0 deletions common/api/common.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,47 @@ final class dev.kord.common.entity/ApplicationCommandOption { // dev.kord.common
}
}

final class dev.kord.common.entity/ApplicationEmojis : kotlin.collections/List<dev.kord.common.entity/DiscordEmoji> { // dev.kord.common.entity/ApplicationEmojis|null[0]
constructor <init>(kotlin.collections/List<dev.kord.common.entity/DiscordEmoji>) // dev.kord.common.entity/ApplicationEmojis.<init>|<init>(kotlin.collections.List<dev.kord.common.entity.DiscordEmoji>){}[0]

final val items // dev.kord.common.entity/ApplicationEmojis.items|{}items[0]
final fun <get-items>(): kotlin.collections/List<dev.kord.common.entity/DiscordEmoji> // dev.kord.common.entity/ApplicationEmojis.items.<get-items>|<get-items>(){}[0]
final val size // dev.kord.common.entity/ApplicationEmojis.size|{}size[0]
final fun <get-size>(): kotlin/Int // dev.kord.common.entity/ApplicationEmojis.size.<get-size>|<get-size>(){}[0]

final fun asJsReadonlyArrayView(): kotlin.js.collections/JsReadonlyArray<dev.kord.common.entity/DiscordEmoji> // dev.kord.common.entity/ApplicationEmojis.asJsReadonlyArrayView|asJsReadonlyArrayView(){}[0]
final fun component1(): kotlin.collections/List<dev.kord.common.entity/DiscordEmoji> // dev.kord.common.entity/ApplicationEmojis.component1|component1(){}[0]
final fun contains(dev.kord.common.entity/DiscordEmoji): kotlin/Boolean // dev.kord.common.entity/ApplicationEmojis.contains|contains(dev.kord.common.entity.DiscordEmoji){}[0]
final fun containsAll(kotlin.collections/Collection<dev.kord.common.entity/DiscordEmoji>): kotlin/Boolean // dev.kord.common.entity/ApplicationEmojis.containsAll|containsAll(kotlin.collections.Collection<dev.kord.common.entity.DiscordEmoji>){}[0]
final fun copy(kotlin.collections/List<dev.kord.common.entity/DiscordEmoji> = ...): dev.kord.common.entity/ApplicationEmojis // dev.kord.common.entity/ApplicationEmojis.copy|copy(kotlin.collections.List<dev.kord.common.entity.DiscordEmoji>){}[0]
final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.common.entity/ApplicationEmojis.equals|equals(kotlin.Any?){}[0]
final fun get(kotlin/Int): dev.kord.common.entity/DiscordEmoji // dev.kord.common.entity/ApplicationEmojis.get|get(kotlin.Int){}[0]
final fun hashCode(): kotlin/Int // dev.kord.common.entity/ApplicationEmojis.hashCode|hashCode(){}[0]
final fun indexOf(dev.kord.common.entity/DiscordEmoji): kotlin/Int // dev.kord.common.entity/ApplicationEmojis.indexOf|indexOf(dev.kord.common.entity.DiscordEmoji){}[0]
final fun isEmpty(): kotlin/Boolean // dev.kord.common.entity/ApplicationEmojis.isEmpty|isEmpty(){}[0]
final fun iterator(): kotlin.collections/Iterator<dev.kord.common.entity/DiscordEmoji> // dev.kord.common.entity/ApplicationEmojis.iterator|iterator(){}[0]
final fun lastIndexOf(dev.kord.common.entity/DiscordEmoji): kotlin/Int // dev.kord.common.entity/ApplicationEmojis.lastIndexOf|lastIndexOf(dev.kord.common.entity.DiscordEmoji){}[0]
final fun listIterator(): kotlin.collections/ListIterator<dev.kord.common.entity/DiscordEmoji> // dev.kord.common.entity/ApplicationEmojis.listIterator|listIterator(){}[0]
final fun listIterator(kotlin/Int): kotlin.collections/ListIterator<dev.kord.common.entity/DiscordEmoji> // dev.kord.common.entity/ApplicationEmojis.listIterator|listIterator(kotlin.Int){}[0]
final fun subList(kotlin/Int, kotlin/Int): kotlin.collections/List<dev.kord.common.entity/DiscordEmoji> // dev.kord.common.entity/ApplicationEmojis.subList|subList(kotlin.Int;kotlin.Int){}[0]
final fun toString(): kotlin/String // dev.kord.common.entity/ApplicationEmojis.toString|toString(){}[0]

final object $serializer : kotlinx.serialization.internal/GeneratedSerializer<dev.kord.common.entity/ApplicationEmojis> { // dev.kord.common.entity/ApplicationEmojis.$serializer|null[0]
final val descriptor // dev.kord.common.entity/ApplicationEmojis.$serializer.descriptor|{}descriptor[0]
final fun <get-descriptor>(): kotlinx.serialization.descriptors/SerialDescriptor // dev.kord.common.entity/ApplicationEmojis.$serializer.descriptor.<get-descriptor>|<get-descriptor>(){}[0]

final fun childSerializers(): kotlin/Array<kotlinx.serialization/KSerializer<*>> // dev.kord.common.entity/ApplicationEmojis.$serializer.childSerializers|childSerializers(){}[0]
final fun deserialize(kotlinx.serialization.encoding/Decoder): dev.kord.common.entity/ApplicationEmojis // dev.kord.common.entity/ApplicationEmojis.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0]
final fun serialize(kotlinx.serialization.encoding/Encoder, dev.kord.common.entity/ApplicationEmojis) // dev.kord.common.entity/ApplicationEmojis.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;dev.kord.common.entity.ApplicationEmojis){}[0]
}

final object Companion { // dev.kord.common.entity/ApplicationEmojis.Companion|null[0]
final val $childSerializers // dev.kord.common.entity/ApplicationEmojis.Companion.$childSerializers|{}$childSerializers[0]

final fun serializer(): kotlinx.serialization/KSerializer<dev.kord.common.entity/ApplicationEmojis> // dev.kord.common.entity/ApplicationEmojis.Companion.serializer|serializer(){}[0]
}
}

final class dev.kord.common.entity/ApplicationFlags { // dev.kord.common.entity/ApplicationFlags|null[0]
final val code // dev.kord.common.entity/ApplicationFlags.code|{}code[0]
final fun <get-code>(): kotlin/Int // dev.kord.common.entity/ApplicationFlags.code.<get-code>|<get-code>(){}[0]
Expand Down
8 changes: 8 additions & 0 deletions common/src/commonMain/kotlin/entity/DiscordEmoji.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,11 @@ public data class DiscordPartialEmoji(
val name: String? = null,
val animated: OptionalBoolean = OptionalBoolean.Missing,
)

/**
* List of application [emojis][DiscordEmoji].
*
* @property items the list of emojis
*/
@Serializable
public data class ApplicationEmojis(val items: List<DiscordEmoji>) : List<DiscordEmoji> by items
57 changes: 40 additions & 17 deletions core/api/core.api
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ public final class dev/kord/core/Kord : kotlinx/coroutines/CoroutineScope {
public final fun editPresence (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun editSelf (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun equals (Ljava/lang/Object;)Z
public final fun getApplicationEmoji (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun getApplicationInfo (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun getApplicationRoleConnectionMetadataRecords (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun getCache ()Ldev/kord/cache/api/DataCache;
public final fun getChannel (Ldev/kord/common/entity/Snowflake;Ldev/kord/core/supplier/EntitySupplyStrategy;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun getChannel$default (Ldev/kord/core/Kord;Ldev/kord/common/entity/Snowflake;Ldev/kord/core/supplier/EntitySupplyStrategy;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public fun getCoroutineContext ()Lkotlin/coroutines/CoroutineContext;
public final fun getDefaultSupplier ()Ldev/kord/core/supplier/EntitySupplier;
public final fun getEmojis ()Lkotlinx/coroutines/flow/Flow;
public final fun getEvents ()Lkotlinx/coroutines/flow/SharedFlow;
public final fun getGateway ()Ldev/kord/core/gateway/MasterGateway;
public final fun getGlobalApplicationCommand (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Expand Down Expand Up @@ -5712,6 +5714,22 @@ public final class dev/kord/core/entity/Application : dev/kord/core/entity/BaseA
public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Strategizable;
}

public final class dev/kord/core/entity/ApplicationEmoji : dev/kord/core/entity/CustomEmoji {
public fun <init> (Ldev/kord/core/cache/data/EmojiData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;)V
public synthetic fun <init> (Ldev/kord/core/cache/data/EmojiData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun delete (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun edit (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun equals (Ljava/lang/Object;)Z
public final fun getApplicationId ()Ldev/kord/common/entity/Snowflake;
public fun getData ()Ldev/kord/core/cache/data/EmojiData;
public fun getKord ()Ldev/kord/core/Kord;
public fun getSupplier ()Ldev/kord/core/supplier/EntitySupplier;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/ApplicationEmoji;
public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Strategizable;
}

public final class dev/kord/core/entity/Asset : dev/kord/core/KordObject {
public static final field Companion Ldev/kord/core/entity/Asset$Companion;
public synthetic fun <init> (ZLdev/kord/rest/route/CdnUrl;Ldev/kord/core/Kord;Ldev/kord/rest/Image$Format;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
Expand Down Expand Up @@ -5885,6 +5903,25 @@ public final class dev/kord/core/entity/ClientStatus$Client$Web : dev/kord/core/
public fun <init> (Ldev/kord/common/entity/PresenceStatus;)V
}

public abstract class dev/kord/core/entity/CustomEmoji : dev/kord/core/entity/Emoji, dev/kord/core/entity/KordEntity, dev/kord/core/entity/Strategizable {
public fun compareTo (Ldev/kord/core/entity/Entity;)I
public synthetic fun compareTo (Ljava/lang/Object;)I
public abstract fun delete (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun delete$default (Ldev/kord/core/entity/CustomEmoji;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public abstract fun getData ()Ldev/kord/core/cache/data/EmojiData;
public fun getId ()Ldev/kord/common/entity/Snowflake;
public final fun getImage ()Ldev/kord/core/entity/Asset;
public fun getMention ()Ljava/lang/String;
public fun getName ()Ljava/lang/String;
public final fun getRequiresColons ()Z
public final fun getUser ()Ldev/kord/core/behavior/UserBehavior;
public final fun getUser (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun getUserId ()Ldev/kord/common/entity/Snowflake;
public final fun isAnimated ()Z
public final fun isAvailable ()Z
public final fun isManaged ()Z
}

public final class dev/kord/core/entity/Embed : dev/kord/core/KordObject {
public fun <init> (Ldev/kord/core/cache/data/EmbedData;Ldev/kord/core/Kord;)V
public final fun apply (Ldev/kord/rest/builder/message/EmbedBuilder;)V
Expand Down Expand Up @@ -6198,36 +6235,22 @@ public final class dev/kord/core/entity/Guild : dev/kord/core/behavior/GuildBeha
public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Strategizable;
}

public final class dev/kord/core/entity/GuildEmoji : dev/kord/core/entity/Emoji, dev/kord/core/entity/KordEntity, dev/kord/core/entity/Strategizable {
public final class dev/kord/core/entity/GuildEmoji : dev/kord/core/entity/CustomEmoji {
public fun <init> (Ldev/kord/core/cache/data/EmojiData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;)V
public synthetic fun <init> (Ldev/kord/core/cache/data/EmojiData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun compareTo (Ldev/kord/core/entity/Entity;)I
public synthetic fun compareTo (Ljava/lang/Object;)I
public final fun delete (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun delete$default (Ldev/kord/core/entity/GuildEmoji;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public fun delete (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun edit (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun equals (Ljava/lang/Object;)Z
public final fun getData ()Ldev/kord/core/cache/data/EmojiData;
public fun getData ()Ldev/kord/core/cache/data/EmojiData;
public final fun getGuildId ()Ldev/kord/common/entity/Snowflake;
public fun getId ()Ldev/kord/common/entity/Snowflake;
public final fun getImage ()Ldev/kord/core/entity/Asset;
public fun getKord ()Ldev/kord/core/Kord;
public final fun getMember ()Ldev/kord/core/behavior/MemberBehavior;
public final fun getMember (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun getMention ()Ljava/lang/String;
public fun getName ()Ljava/lang/String;
public final fun getRequiresColons ()Z
public final fun getRoleBehaviors ()Ljava/util/Set;
public final fun getRoleIds ()Ljava/util/Set;
public final fun getRoles ()Lkotlinx/coroutines/flow/Flow;
public fun getSupplier ()Ldev/kord/core/supplier/EntitySupplier;
public final fun getUser ()Ldev/kord/core/behavior/UserBehavior;
public final fun getUser (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun getUserId ()Ldev/kord/common/entity/Snowflake;
public fun hashCode ()I
public final fun isAnimated ()Z
public final fun isAvailable ()Z
public final fun isManaged ()Z
public fun toString ()Ljava/lang/String;
public fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/GuildEmoji;
public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Strategizable;
Expand Down
Loading