feat: make embed helper functions use EmbedColor instead of color

Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
moonleay 2023-09-14 12:34:27 +02:00
parent dcdb5c6e56
commit 8d14597a38

View file

@ -22,7 +22,6 @@ import com.kotlindiscord.kord.extensions.commands.Arguments
import com.kotlindiscord.kord.extensions.commands.application.slash.PublicSlashCommandContext
import com.kotlindiscord.kord.extensions.components.forms.ModalForm
import com.kotlindiscord.kord.extensions.types.respond
import dev.kord.common.Color
import dev.kord.core.entity.Embed
import dev.kord.rest.builder.message.EmbedBuilder
import java.time.LocalDateTime
@ -34,7 +33,7 @@ object MessageUtil {
///Send an embedded message as a reply
suspend fun sendEmbedForPublicSlashCommand(
ctx: PublicSlashCommandContext<Arguments, ModalForm>,
color: Color,
color: EmbedColor,
title: String,
description: String
) {
@ -53,7 +52,7 @@ object MessageUtil {
///Send an embedded message with an image as a reply
suspend fun sendEmbedForPublicSlashCommandWithImage(
ctx: PublicSlashCommandContext<Arguments, ModalForm>,
color: Color,
color: EmbedColor,
title: String,
description: String,
thumbnailUrl: String
@ -103,7 +102,7 @@ object MessageUtil {
}
fun getEmbedWithTableWithFooter(
color: Color,
color: EmbedColor,
title: String,
description: String,
values: Map<String, List<String>>?,
@ -117,7 +116,7 @@ object MessageUtil {
///Get an embedded msg with image, title and description
fun getEmbedWithTable(
color: Color,
color: EmbedColor,
title: String,
description: String,
values: Map<String, List<String>>?
@ -140,20 +139,20 @@ object MessageUtil {
///Get an embedded msg with title and description
fun getEmbedSmall(
color: Color,
color: EmbedColor,
title: String,
description: String
): EmbedBuilder {
val ebb = EmbedBuilder()
ebb.title = title
ebb.description = description
ebb.color = color
ebb.color = color.color
return ebb
}
///Get an embedded msg with title, description and a src
fun getEmbed(
color: Color,
color: EmbedColor,
title: String,
description: String,
source: String
@ -167,7 +166,7 @@ object MessageUtil {
///Get an embedded msg with image, title, description and a src
fun getEmbedWithImage(
color: Color,
color: EmbedColor,
title: String,
description: String,
source: String,