feat: 絵文字を識別するIDの生成を追加

This commit is contained in:
usbharu 2023-12-21 19:14:02 +09:00
parent b070b8c71d
commit 80f4e9fb04
1 changed files with 9 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import java.time.Instant
sealed class Emoji {
abstract val domain: String
abstract val name: String
abstract fun id(): String
}
data class CustomEmoji(
@ -15,10 +16,17 @@ data class CustomEmoji(
val url: String,
val category: String,
val createdAt: Instant
) : Emoji()
) : Emoji() {
override fun id(): String {
return id.toString()
}
}
data class UnicodeEmoji(
override val name: String
) : Emoji() {
override val domain: String = "unicode.org"
override fun id(): String {
return name
}
}