feat: improved getAClonedEmbed function, added an equivalent using a EmbedBuilder
Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
parent
9c27e13ec6
commit
5431515976
1 changed files with 24 additions and 2 deletions
|
@ -71,11 +71,33 @@ object MessageUtil {
|
|||
}
|
||||
}
|
||||
|
||||
///Get a cloned embedded message, missing only the fields
|
||||
fun getAClonedEmbedd(e: Embed): EmbedBuilder {
|
||||
///Get a cloned embedded message
|
||||
fun getAClonedEmbed(e: Embed): EmbedBuilder {
|
||||
val ebb = EmbedBuilder()
|
||||
ebb.color = e.color
|
||||
ebb.title = e.title
|
||||
e.fields.forEach {
|
||||
val fb = EmbedBuilder.Field()
|
||||
fb.name = it.name
|
||||
fb.value = it.value
|
||||
fb.inline = it.inline
|
||||
ebb.fields.add(fb)
|
||||
}
|
||||
ebb.description = e.description
|
||||
return ebb
|
||||
}
|
||||
|
||||
fun getAClonedEmbed(e: EmbedBuilder): EmbedBuilder {
|
||||
val ebb = EmbedBuilder()
|
||||
ebb.color = e.color
|
||||
ebb.title = e.title
|
||||
e.fields.forEach {
|
||||
val fb = EmbedBuilder.Field()
|
||||
fb.name = it.name
|
||||
fb.value = it.value
|
||||
fb.inline = it.inline
|
||||
ebb.fields.add(fb)
|
||||
}
|
||||
ebb.description = e.description
|
||||
return ebb
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue